#include using namespace std; using ll = long long; const ll MOD = 1000000007; ll modpow(ll x, ll n, ll mod = MOD) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % mod; x = x * x % mod; n >>= 1; } return res; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, d, K; cin >> n >> d >> K; vector dp(K + 1, 0); dp[0] = 1; for (int i = 0; i < n; ++i) { vector ndp(K + 1, 0); ll sum = 0; for (int j = 0; j <= K; ++j) { if (j > d) sum = (sum + MOD - dp[j - d - 1]) % MOD; ndp[j] = sum; (sum += dp[j]) %= MOD; } dp = move(ndp); } cout << dp[K] << "\n"; return 0; }