#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
inline int add(int a, int b) { return (a += b) >= MOD ? a - MOD : a; }
inline int sub(int a, int b) { return (a -= b) < 0 ? a + MOD : a; }
inline int mul(int a, int b) { return 1ll * a * b % MOD; }
inline void upd(int& a, int b) { (a += b) >= MOD ? a -= MOD : 233; }
inline int qpow(int a, int p) {
  int ret = 1;
  for (; p; p >>= 1, a = mul(a, a))
    if (p & 1) ret = mul(ret, a);
  return ret;
}
inline int read() {
  int ret, cc, sign = 1;
  while (!isdigit(cc = getchar())) sign = cc == '0' ? -1 : sign;
  ret = cc - 48;
  while (isdigit(cc = getchar())) ret = cc - 48 + ret * 10;
  return ret * sign;
}
const int MAXN = 210;
struct matrix {
  int n, m;
  int a[MAXN][MAXN];
  matrix(int n = 0, int m = 0) : n(n), m(m) { memset(a, 0, sizeof a); }
  inline int* operator[](int x) { return a[x]; }
  inline const int* operator[](int x) const { return a[x]; }
  inline matrix operator*(const matrix& rhs) const {
    matrix ret(n, rhs.m);
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j)
        if (a[i][j])
          for (int k = 1; k <= rhs.m; ++k)
            ret[i][k] = add(ret[i][k], mul(a[i][j], rhs[j][k]));
    return ret;
  }
};
int num[20][20];
int cnt[20];
int tot;
int n, K, m, U;
int main() {
  scanf("%d%d%d", &n, &K, &m), U = (1 << m) - 1;
  for (int i = 0; i <= K; ++i)
    for (int S = 0; S <= U; ++S) num[i][S] = ++tot;
  for (int i = 0; i <= U; ++i) cnt[i] = cnt[i >> 1] + (i & 1);
  matrix A(tot, tot), F(tot, tot);
  for (int i = 0; i <= K; ++i) {
    for (int S = 0; S <= U; ++S) {
      int T = S << 1 & U;
      upd(F[num[i][S]][num[i][T]], 1);
      if (i < K) upd(F[num[i][S]][num[i + 1][T | 1]], cnt[S] + 1);
    }
  }
  A[1][1] = 1;
  while (n) {
    if (n & 1) A = A * F;
    F = F * F, n >>= 1;
  }
  int ans = 0;
  for (int S = 0; S <= U; ++S) upd(ans, A[1][num[K][S]]);
  printf("%d\n", ans);
}
