#include <bits/stdc++.h>
using namespace std;
int n, m, K, N;
int Bit[233];
int Num[233][233];
class Matrix {
 public:
  int A[233][233], n;
  Matrix() {}
  Matrix(int x) {
    clear();
    n = x;
  }
  void clear() { memset(A, 0, sizeof(A)); }
  void SetOne() {
    clear();
    for (int i = 1; i <= n; i++) A[i][i] = 1;
  }
  int *operator[](int x) { return A[x]; }
};
Matrix operator*(Matrix &a, Matrix &b) {
  int n = a.n;
  Matrix c(n);
  c.clear();
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      for (int k = 1; k <= n; ++k)
        c[i][j] = (c[i][j] + 1ll * a[i][k] * b[k][j]) % 1000000007;
  return c;
}
int main() {
  scanf("%d%d%d", &n, &K, &m);
  N = (1 << m) * (K + 1);
  for (int i = 1; i < (1 << m); i++) Bit[i] = Bit[i >> 1] + (i & 1);
  Matrix A(N), B(N);
  int x, Cnt = 0;
  for (int i = 0; i <= K; i++)
    for (int j = 0; j < (1 << m); j++) Num[i][j] = ++Cnt;
  A[1][1] = 1;
  for (int i = 0; i <= K; i++)
    for (int j = 0; j < (1 << m); j++) {
      x = (j << 1) & ((1 << m) - 1);
      B[Num[i][j]][Num[i][x]]++;
      if (i != K) B[Num[i][j]][Num[i + 1][x | 1]] += Bit[j] + 1;
    }
  while (n) {
    if (n & 1) A = A * B;
    B = B * B;
    n >>= 1;
  }
  long long Ans = 0;
  for (int i = 0; i < (1 << m); i++) Ans = (Ans + A[1][Num[K][i]]) % 1000000007;
  printf("%I64d\n", Ans);
  return 0;
}
