#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
int n, k, m, N, bit[1 << 4], ans, cnt;
struct Mat {
  int a[220][220];
  Mat() { memset(a, 0, sizeof(a)); }
  int* operator[](int x) { return a[x]; }
} I, A;
void upd(int& x, int y) {
  x += y;
  (x >= P) && (x -= P);
}
Mat operator*(Mat a, Mat b) {
  Mat c;
  for (int i = (0); i <= (cnt); ++i)
    for (int j = (0); j <= (cnt); ++j)
      for (int k = (0); k <= (cnt); ++k)
        c[i][j] = (c[i][j] + 1ll * a[i][k] * b[k][j] % P) % P;
  return c;
}
Mat operator^(Mat a, int b) {
  Mat ans = I;
  for (; b; b >>= 1, a = a * a)
    if (b & 1) ans = ans * a;
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &k, &m);
  N = 1 << m;
  for (int S = (1); S <= (N - 1); ++S) bit[S] = bit[S >> 1] + (S & 1);
  cnt = (k + 1) * N - 1;
  for (int i = (0); i <= (cnt); ++i) I[i][i] = 1;
  for (int i = (0); i <= (k); ++i)
    for (int S = (0); S <= (N - 1); ++S) {
      int T = (S << 1) & (N - 1);
      upd(A[((i)*N + (S))][((i)*N + (T))], 1);
      if (i < k) upd(A[((i)*N + (S))][((i + 1) * N + (T | 1))], bit[S] + 1);
    }
  A[0][0] = 1;
  A = A ^ n;
  ans = 0;
  for (int S = (0); S <= (N - 1); ++S) upd(ans, A[0][((k)*N + (S))]);
  printf("%d\n", ans);
  return 0;
}
