#include <bits/stdc++.h>
using namespace std;
const int64_t INF = 1e18, MOD = 1e9 + 7;
int64_t n, k, m;
int64_t conv(int64_t j, int64_t mask) { return mask + j * (1 << m); }
void add(int64_t& a, int64_t b) { a = (a + b) % MOD; }
vector<vector<int64_t> > operator*(const vector<vector<int64_t> >& a,
                                   const vector<vector<int64_t> >& b) {
  vector<vector<int64_t> > mat(a.size(), vector<int64_t>(b[0].size(), 0));
  for (int64_t i = 0; i < a.size(); i++) {
    for (int64_t j = 0; j < b[0].size(); j++) {
      for (int64_t k = 0; k < b.size(); k++) {
        add(mat[i][j], a[i][k] * b[k][j]);
      }
    }
  }
  return mat;
}
vector<vector<int64_t> > identity(int64_t n) {
  vector<vector<int64_t> > mat(n, vector<int64_t>(n, 0));
  for (int64_t i = 0; i < n; i++) mat[i][i] = 1;
  return mat;
}
vector<vector<int64_t> > power(const vector<vector<int64_t> >& b, int64_t p) {
  if (p == 0) return identity(b.size());
  vector<vector<int64_t> > mat = power(b, p / 2);
  mat = mat * mat;
  if (p & 1) mat = mat * b;
  return mat;
}
void print(vector<vector<int64_t> >& a) {
  for (int64_t i = 0; i < a.size(); i++) {
    for (int64_t j = 0; j < a[i].size(); j++) cout << a[i][j] << " ";
    cout << endl;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k >> m;
  vector<vector<int64_t> > mat((k + 1) * (1 << m),
                               vector<int64_t>((k + 1) * (1 << m)));
  for (int64_t j = 0; j < k + 1; j++) {
    for (int64_t mask = 0; mask < 1 << m; mask++) {
      int64_t next = (mask << 1) & ((1 << m) - 1);
      add(mat[conv(j, mask)][conv(j, next)], 1);
      if (j < k)
        add(mat[conv(j, mask)][conv(j + 1, next | 1)],
            __builtin_popcount(mask) + 1);
    }
  }
  mat = power(mat, n);
  vector<vector<int64_t> > base(mat.size(), vector<int64_t>(mat.size(), 0));
  base[0][0] = 1;
  mat = base * mat;
  int64_t ans = 0;
  for (int64_t mask = 0; mask < 1 << m; mask++) add(ans, mat[0][conv(k, mask)]);
  cout << ans << endl;
  return 0;
}
