#include <bits/stdc++.h>
using namespace std;
int n, k, m;
long long mat[256][256], dp[2][256];
void inmult(long long a[256][256], long long b[256][256], int n1, int m1,
            int n2, int m2) {
  long long rez[256][256];
  for (int i = 1; i <= n1; ++i)
    for (int j = 1; j <= m2; ++j) rez[i][j] = 0LL;
  for (int h = 1; h <= m1; ++h)
    for (int i = 1; i <= n1; ++i)
      for (int j = 1; j <= m2; ++j) {
        rez[i][j] += a[i][h] * b[h][j];
        rez[i][j] %= 1000000007LL;
      }
  for (int i = 1; i <= n1; ++i)
    for (int j = 1; j <= m2; ++j) a[i][j] = rez[i][j];
}
void put(long long mat[256][256], int n, int sizee) {
  long long id[256][256];
  for (int i = 1; i <= sizee; ++i)
    for (int j = 1; j <= sizee; ++j) id[i][j] = (i == j ? 1LL : 0LL);
  for (int i = 0; (1 << i) <= n; ++i) {
    if ((1 << i) & n) inmult(id, mat, sizee, sizee, sizee, sizee);
    inmult(mat, mat, sizee, sizee, sizee, sizee);
  }
  for (int i = 1; i <= sizee; ++i)
    for (int j = 1; j <= sizee; ++j) mat[i][j] = id[i][j];
}
int indice(int kk, int mask) { return mask * (k + 1) + kk + 1; }
int main() {
  scanf("%d %d %d", &n, &k, &m);
  int sizee = (k + 1) * (1 << m);
  for (int i = 1; i <= sizee; ++i) dp[1][i] = 0LL;
  dp[1][1] = 1LL;
  for (int i = 0; i <= k; ++i)
    for (int mask = 0; mask < (1 << m); ++mask) {
      int newmask = (mask << 1) % (1 << m);
      mat[indice(i, mask)][indice(i, newmask)] = 1LL;
      newmask |= 1;
      if (i < k)
        mat[indice(i, mask)][indice(i + 1, newmask)] =
            1LL + 1LL * __builtin_popcount(mask);
    }
  put(mat, n, sizee);
  inmult(dp, mat, 1, sizee, sizee, sizee);
  long long rez = 0LL;
  for (int mask = 0; mask < (1 << m); ++mask) {
    rez += dp[1][indice(k, mask)];
    rez %= 1000000007LL;
  }
  printf("%I64d\n", rez);
  return 0;
}
