------
## 最终结论
```python
def profitableSchemes(G, P, group, profit):
    MOD = 10**9 + 7
    n = len(group)
    
    # dp[i][j] means the number of schemes with exactly i members and at least j profit
    dp = [[0] * (P + 1) for _ in range(G + 1)]
    dp[0][0] = 1
    
    for k in range(n):
        g = group[k]
        p = profit[k]
        # Traverse backwards to avoid overwriting results from the current round
        for i in range(G, g - 1, -1):
            for j in range(P, -1, -1):
                dp[i][min(P, j + p)] += dp[i - g][j]
                dp[i][min(P, j + p)] %= MOD
    
    return sum(dp[i][P] for i in range(G + 1)) % MOD

# Example usage:
G1 = 5
P1 = 3
group1 = [2, 2]
profit1 = [2, 3]
print(profitableSchemes(G1, P1, group1, profit1)) # Output: 2

G2 = 10
P2 = 5
group2 = [2, 3, 5]
profit2 = [6, 7, 8]
print(profitableSchemes(G2, P2, group2, profit2)) # Output: 7
```