#include using namespace std; using i64 = long long; const i64 MOD = 1e9 + 7; const i64 INF = i64(1e18) + 7; template bool chmin(T& x, T y){ if(x > y){ x = y; return true; } return false; } template bool chmax(T& x, T y){ if(x < y){ x = y; return true; } return false; } template struct ModInt{ i64 p; ModInt() : p(0){} ModInt(i64 x){p = x >= 0 ? x % mod : x + (-x + mod - 1) / mod * mod;} ModInt& operator+=(const ModInt& y){p = p + *y - ((p + *y) >= mod ? mod : 0); return *this;} ModInt& operator-=(const ModInt& y){p = p - *y + (p - *y < 0 ? mod : 0); return *this;} ModInt& operator*=(const ModInt& y){p = (p * *y) % mod; return *this;} ModInt& operator%=(const ModInt& y){if(y)p %= *y; return *this;} ModInt operator+(const ModInt& y) const{ModInt x = *this; return x += y;} ModInt operator-(const ModInt& y) const{ModInt x = *this; return x -= y;} ModInt operator*(const ModInt& y) const{ModInt x = *this; return x *= y;} ModInt operator%(const ModInt& y) const{ModInt x = *this; return x %= y;} friend ostream& operator<<(ostream& stream, const ModInt& x){ stream << *x; return stream; } friend ostream& operator>>(ostream& stream, const ModInt& x){ stream >> *x; return stream; } ModInt& operator++(){p = (p + 1) % mod; return *this;} ModInt& operator--(){p = (p - 1 + mod) % mod; return *this;} bool operator==(const ModInt& y) const{return p == *y;} bool operator!=(const ModInt& y) const{return p != *y;} const i64& operator*() const{return p;} i64& operator*(){return p;} }; using mint = ModInt<>; template struct BIT{ vector elm; BIT(int n, T init = T()) : elm(n + 1, init){ } // [0, x) T sum(int x){ T val = 0; for(; x > 0; x -= x & -x) val += elm[x]; return val; } // [l, r) T sum(int l, int r){ return sum(r) - sum(l); } void add(int x, T val){ for(++x; x < elm.size(); x += x & -x) elm[x] += val; } }; signed main(){ int n, d, k; cin >> n >> d >> k; // セグ木じゃ通らないんかーい! vector> dp(n + 1, BIT(k + 1)); dp[0].add(0, 1); for(int i = 0; i < n; ++i) for(int j = 0; j <= k; ++j) dp[i + 1].add(j, dp[i].sum(max(0, j - d), j)); cout << dp.back().sum(k, k + 1) << endl; return 0; }