#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MAXN = 10 + 5;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
long long mat2[300][300];
vector<vector<long long> > mult(vector<vector<long long> > m1,
                                vector<vector<long long> > m2, long long rc,
                                long long mod) {
  vector<vector<long long> > newvec;
  for (long long i = (0); i <= (rc - 1); i++) {
    newvec.push_back(vector<long long>());
    for (long long j = (0); j <= (rc - 1); j++) {
      newvec[i].push_back(0);
    }
  }
  for (long long i = (0); i <= (rc - 1); i++) {
    for (long long j = (0); j <= (rc - 1); j++) {
      for (long long k = (0); k <= (rc - 1); k++) {
        newvec[i][j] += m1[i][k] * m2[k][j];
        newvec[i][j] %= mod;
      }
    }
  }
  return newvec;
}
vector<vector<long long> > ex(vector<vector<long long> > base, long long power,
                              long long mod, long long rc) {
  vector<vector<long long> > res;
  for (long long i = (0); i <= (rc - 1); i++) {
    res.push_back(vector<long long>());
    for (long long j = (0); j <= (rc - 1); j++) {
      if (i == j)
        res[i].push_back(1);
      else
        res[i].push_back(0);
    }
  }
  while (power) {
    if (power & 1) res = mult(res, base, rc, mod);
    base = mult(base, base, rc, mod);
    power >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k, m;
  cin >> n >> k >> m;
  long long masks = 1ll << m;
  long long sz = (k + 1) * masks;
  long long cnt = 0;
  for (long long j = (0); j <= (k); j++) {
    for (long long mask = (0); mask <= (masks - 1); mask++) {
      long long newmask = (mask << 1) % (1 << m);
      long long newindex;
      if (j < k) {
        newindex = (j + 1) * masks + (newmask | 1);
        mat2[newindex][cnt] += __builtin_popcountll(mask) + 1;
      }
      newindex = j * masks + newmask;
      mat2[newindex][cnt]++;
      cnt++;
    }
  }
  vector<vector<long long> > v;
  for (long long i = (0); i <= (sz - 1); i++) {
    v.push_back(vector<long long>());
    for (long long j = (0); j <= (sz - 1); j++) v[i].push_back(mat2[i][j]);
  }
  vector<vector<long long> > final = ex(v, n, MOD, sz);
  long long ans = 0, startid = k * masks;
  for (long long i = (startid); i <= (sz - 1); i++) {
    ans += final[i][0];
    ans %= MOD;
  }
  cout << ans;
}
