#include <bits/stdc++.h>
using namespace std;
long long read() {
  int f = 1;
  long long res = 0;
  char ch;
  do {
    ch = getchar();
    if (ch == '-') f = -f;
  } while (ch < '0' || ch > '9');
  do {
    res = res * 10 + ch - '0';
    ch = getchar();
  } while (ch >= '0' && ch <= '9');
  return f == 1 ? res : -res;
}
const int N = 5010;
const int INF = 1000000000;
int n, m, q, K;
int mod = 1000000007;
int head[N], to[N << 1], nxt[N << 1], color[N << 1], tot;
char str[N];
int A[N], B[N];
void addEdge(int u, int v) {
  tot++;
  nxt[tot] = head[u];
  to[tot] = v;
  head[u] = tot;
}
long long myPow(long long a, int b) {
  if (b == 0) return 1;
  long long ans = myPow(a, b / 2);
  ans *= ans;
  ans %= mod;
  if (b % 2 == 1) {
    ans *= a;
    ans %= mod;
  }
  return ans;
}
void addMod(int &a, long long b) { a = (a + b) % mod; }
int mulMod(int a, int b) { return 1LL * a * b % mod; }
long long mmin(long long a, long long b) { return a < b ? a : b; }
long long mmax(long long a, long long b) { return a > b ? a : b; }
bool contain(int set, int i) { return (set & (1 << i)) > 0; }
int countOne(int set) {
  int res = 0;
  while (set) {
    res++;
    set &= set - 1;
  }
  return res;
}
struct Matrix {
  vector<vector<int>> a;
  int n, m;
  Matrix(int n, int m) : n(n), m(m) { a.assign(n, vector<int>(m, 0)); }
  friend Matrix operator*(Matrix a, Matrix b) {
    Matrix c(a.n, b.m);
    for (int i = 0; i < a.n; i++)
      for (int j = 0; j < b.m; j++)
        for (int k = 0; k < a.m; k++) {
          addMod(c.a[i][j], 1LL * a.a[i][k] * b.a[k][j]);
        }
    return c;
  }
};
void power(Matrix &a, int n, Matrix &b) {
  while (n > 0) {
    if (n & 1) b = a * b;
    a = a * a;
    n >>= 1;
  }
}
int toId(int j, int mask) { return j * (1 << m) + mask; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> K >> m;
  Matrix f((K + 1) * (1 << m), (K + 1) * (1 << m));
  Matrix dp((K + 1) * (1 << m), 1);
  dp.a[0][0] = 1;
  for (int j = 0; j <= K; j++)
    for (int mask = 0; mask < (1 << m); mask++) {
      int nmask = (mask << 1) % (1 << m);
      int cur = toId(j, mask);
      f.a[toId(j, nmask)][cur] = 1;
      if (j < K) {
        f.a[toId(j + 1, nmask | 1)][cur] = countOne(mask) + 1;
      }
    }
  power(f, n, dp);
  int ans = 0;
  for (int mask = 0; mask < (1 << m); mask++)
    addMod(ans, dp.a[toId(K, mask)][0]);
  cout << ans << endl;
  return 0;
}
