------
## 最终结论
```python
def numRollsToTarget(d, f, target):
    MOD = 10**9 + 7
    dp = [[0] * (target + 1) for _ in range(d + 1)]
    dp[0][0] = 1
    
    for i in range(1, d + 1):  # 遍历骰子数
        for j in range(1, target + 1):  # 遍历可能的和
            for k in range(1, f + 1):  # 尝试每个可能的面值
                if j - k >= 0:  # 确保不为负
                    dp[i][j] = (dp[i][j] + dp[i - 1][j - k]) % MOD
    
    return dp[d][target]
```