#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
bool chkmin(T1 &x, T2 y) {
  return y < x ? (x = y, true) : false;
}
template <typename T1, typename T2>
bool chkmax(T1 &x, T2 y) {
  return y > x ? (x = y, true) : false;
}
const int N = 100005;
int n, k, m;
const int MOD = (int)1e9 + 7;
inline int add(int x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
  return x;
}
inline void vadd(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
inline int sub(int x, int y) {
  x -= y;
  if (x < 0) x += MOD;
  return x;
}
inline int mult(int x, int y) { return x * (long long)y % MOD; }
using matrix_t = vector<vector<int> >;
matrix_t operator*(const matrix_t &A, const matrix_t &B) {
  int n1 = A.size();
  int n2 = A[0].size();
  assert(n2 == B.size());
  int n3 = B[0].size();
  matrix_t C(n1, vector<int>(n3, 0));
  for (int i = 0; i < n1; ++i) {
    for (int j = 0; j < n3; ++j) {
      for (int r = 0; r < n2; ++r) {
        vadd(C[i][j], mult(A[i][r], B[r][j]));
      }
    }
  }
  return C;
}
matrix_t matrix_pow(matrix_t A, long long p) {
  if (p == 1) return A;
  if (p & 1) return A * matrix_pow(A, p - 1);
  matrix_t B = matrix_pow(A, p >> 1);
  return B * B;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k >> m;
  int M = (1 << m) * (k + 1);
  matrix_t A(M, vector<int>(M, 0));
  for (int mask = 0; mask < (1 << m); ++mask) {
    for (int d = 0; d <= k; ++d) {
      int shift = (mask << 1) & ((1 << m) - 1);
      vadd(A[shift * (k + 1) + d][mask * (k + 1) + d], 1);
      if (d < k)
        vadd(A[(shift | 1) * (k + 1) + d + 1][mask * (k + 1) + d],
             __builtin_popcount(mask) + 1);
    }
  }
  A = matrix_pow(A, n);
  matrix_t dp0(M, vector<int>(1, 0));
  dp0[0][0] = 1;
  auto dp = A * dp0;
  int ans = 0;
  for (int mask = 0; mask < (1 << m); ++mask)
    vadd(ans, dp[mask * (k + 1) + k][0]);
  cout << ans << '\n';
  return 0;
}
