#include using namespace std; template class ModInt { public: int64_t x; constexpr ModInt() : x(0) {} constexpr ModInt(int64_t v) : x((v % MOD + MOD) % MOD) {} constexpr ModInt operator - () const noexcept { return x ? MOD - x : 0;} constexpr ModInt operator + (const ModInt a) const noexcept { return ModInt(*this) += a;} constexpr ModInt operator - (const ModInt a) const noexcept { return ModInt(*this) -= a;} constexpr ModInt operator * (const ModInt a) const noexcept { return ModInt(*this) *= a;} constexpr ModInt operator / (const ModInt a) const noexcept { return ModInt(*this) /= a;} constexpr ModInt operator / (const int64_t a) const noexcept { return ModInt(*this) /= a;} constexpr ModInt operator += (const ModInt a) noexcept { x += a.x; if (x >= MOD) x -= MOD; return *this; } constexpr ModInt operator += (const int64_t a) noexcept { auto hs = ModInt(a); (*this) += hs; return *this; } constexpr ModInt operator -= (const ModInt a) noexcept { if (x < a.x) x += MOD; x -= a.x; return *this; } constexpr ModInt operator -= (const int64_t a) noexcept { auto hs = ModInt(a); (*this) -= hs; return *this; } constexpr ModInt operator *= (const ModInt a) noexcept { x = x * a.x % MOD; return *this; } constexpr ModInt operator *= (const int64_t a) noexcept { auto hs = ModInt(a); (*this) *= hs; return *this; } constexpr ModInt &operator /= (ModInt a) noexcept { int64_t exp = MOD - 2; while (exp > 0) { if (exp & 1ul) *this *= a; a *= a; exp >>= 1ul; } return *this; } constexpr ModInt &operator /= (int64_t a) noexcept { auto hs = ModInt(a); (*this) /= hs; return *this; } constexpr ModInt &operator ++ () noexcept { if (++x >= MOD) x -= MOD; return *this; } constexpr ModInt &operator -- () noexcept { if (x-- == 0) x += MOD; return *this; } constexpr bool operator < (const ModInt a) const noexcept { return x < a.x;} constexpr bool operator == (const ModInt a) const noexcept { return this->x == a.x;} constexpr bool operator != (const ModInt a) const noexcept { return !(*this == a);} friend istream &operator >> (istream &in, ModInt &m) { in >> m.x; if (m.x < 0) m.x += MOD; m.x %= MOD; return in; } friend ostream &operator << (ostream &out, const ModInt &p) { return out << p.x;} constexpr ModInt pow(int64_t p) const { ModInt ret(1); ModInt mul(x); while (p > 0) { if (p & 1ul) ret *= mul; mul *= mul; p >>= 1ul; } return ret; } }; const int64_t MOD = 1000000007LL; using mint = ModInt; template class Fenwick { private: vector dat; int n; public: Fenwick(int _n) : dat(_n + 1), n(_n) {} // sum of [1, i] T sum(int i) { T s = 0; while(i > 0) s += dat[i], i -= i & -i; return s; } // sum of [l, r] T sum(int l, int r) { return l > r ? 0 : sum(r) - sum(l - 1); } void add(int i, T x) { while(i <= n) dat[i] += x, i += i & -i; } }; int main() { int N, d, K; cin >> N >> d >> K; const int M = 90009; using FEN = Fenwick; vector fen(N + 1, FEN(M + 2)); fen[0].add(1, 1); for(int i = 1; i <= N; ++i) { for(int j = 1; j <= M; ++j) { fen[i].add(j + 1, fen[i - 1].sum(max(0, j - d) + 1, j)); } } cout << fen[N].sum(K + 1, K + 1) << '\n'; return 0; }