#include <bits/stdc++.h>
long long n, k, m, cnt;
long long id[15][20];
struct matrix {
  long long c[210][210];
  matrix() { memset(c, 0, sizeof(c)); }
  matrix operator*(matrix &v) {
    matrix ans;
    for (long long i = 1; i <= cnt; i++)
      for (long long j = 1; j <= cnt; j++)
        for (long long k = 1; k <= cnt; k++)
          ans[i][j] = (ans[i][j] + c[i][k] * v[k][j] % 1000000007) % 1000000007;
    return ans;
  }
  long long *operator[](long long x) { return c[x]; }
} g, f;
signed main() {
  scanf("%lld %lld %lld", &n, &k, &m);
  for (long long i = 0; i <= k; i++)
    for (long long j = 0; j < (1 << m); j++) id[i][j] = ++cnt;
  for (long long i = 0; i <= k; i++)
    for (long long s = 0; s < (1 << m); s++) {
      long long t = s << 1 & ((1 << m) - 1);
      (g[id[i][s]][id[i][t]] += 1) %= 1000000007;
      if (i < k)
        (g[id[i][s]][id[i + 1][t | 1]] += __builtin_popcount(s) + 1) %=
            1000000007;
    }
  f[1][1] = 1;
  while (n) {
    if (n & 1) f = f * g;
    g = g * g;
    n >>= 1;
  }
  long long ret = 0;
  for (long long i = 0; i < (1 << m); i++)
    ret = (ret + f[1][id[k][i]]) % 1000000007;
  printf("%lld\n", ret);
  return 0;
}
