#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int mod = 1e9 + 7;
int n, k, m, all;
inline void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
struct mat {
  int a[210][210];
  mat() { memset(a, 0, sizeof a); }
  inline mat operator*(const mat &o) const {
    mat re;
    for (int k = 0; k < all; ++k)
      for (int i = 0; i < all; ++i)
        if (a[i][k])
          for (int j = 0; j < all; ++j)
            if (o.a[k][j]) add(re.a[i][j], 1ll * a[i][k] * o.a[k][j] % mod);
    return re;
  }
  inline mat operator^(int b) const {
    mat re, A = *this;
    for (int i = 0; i < all; ++i) re.a[i][i] = 1;
    while (b) {
      if (b & 1) re = re * A;
      A = A * A;
      b >>= 1;
    }
    return re;
  }
};
inline int enc(int K, int S) { return K * (1 << m) + S; }
inline int nxt(int S, bool x) { return ((S << 1) | x) & ((1 << m) - 1); }
int cnt[16];
int main() {
  scanf("%d%d%d", &n, &k, &m);
  all = (k + 1) * (1 << m);
  mat trans, ans;
  ans.a[0][enc(0, 0)] = 1;
  for (int s = 1; s < (1 << m); ++s) cnt[s] = cnt[s >> 1] + (s & 1);
  for (int i = 0; i <= k; ++i)
    for (int s = 0; s < (1 << m); ++s) {
      if (i < k) trans.a[enc(i, s)][enc(i + 1, nxt(s, 1))] = cnt[s] + 1;
      trans.a[enc(i, s)][enc(i, nxt(s, 0))] = 1;
    }
  ans = ans * (trans ^ n);
  int Ans = 0;
  for (int s = 0; s < (1 << m); ++s) add(Ans, ans.a[0][enc(k, s)]);
  printf("%d\n", (Ans + mod) % mod);
}
