#include using namespace std; const long long MOD = 1e9 + 7; long long solve(int n, int s, int k) { int r = s; for (int i = 0; i < n; i++) r -= i * k; if (r == 0) return 1; if (r < 0) return 0; vector > dp(n + 1, vector(r + 1)); dp[0][0] = 1; for (int i = 0; i < n; i++) { for (int j = 0; j <= r; j++) { if (j-n+i >= 0) { dp[i+1][j] += (dp[i][j-n+i] + dp[i+1][j-n+i]) % MOD; dp[i+1][j] %= MOD; } } for (int j = 0; j <= r; j++) { dp[i+1][j] += dp[i][j]; dp[i+1][j] %= MOD; } } return dp[n][r]; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, s, k; cin >> n >> s >> k; cout << solve(n, s, k) << endl; return 0; }