#include using namespace std; typedef long long ll; const double pi=3.141592653589793; typedef unsigned long long ull; typedef long double ldouble; const ll INF=1e18; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } int main(){ int N, S, K, mod = 1e9+7; cin >> N >> S >> K; if(N * (N-1) / 2 * K > S) { cout << 0 << endl; return 0; } int M = N; N = S - K * (N-1) * N / 2; vector > dp(M+1, vector(N+1)); dp[0][0] = 1; rep2(i, 1, M+1){ rep(j, N+1){ if(j-i >= 0) { dp[i][j] = (dp[i-1][j] + dp[i][j-i]) % mod; } else { dp[i][j] = dp[i-1][j]; } } } cout << dp[M][N] << endl; }