#include <bits/stdc++.h>
using namespace std;
const long long Mo = 1e9 + 7;
int cnt[1 << 6], sz;
void add(long long &x, long long y) {
  x += y;
  x %= Mo;
}
void gao(int n, int C, int R, vector<vector<long long>> &Ma) {
  int loop = 1 << R;
  for (int i = 0; i < sz; i++) {
    int c = i / loop, r = i % loop;
    int a1 = r >> 1, a2 = r >> 1 | (1 << (R - 1));
    if ((r & 1) && c != 0) {
      Ma[c * loop + a1 - loop][i] += cnt[a1] + 1;
      Ma[c * loop + a2 - loop][i] += cnt[a2] + 1;
    } else if (!(r & 1)) {
      Ma[c * loop + a1][i] += 1;
      Ma[c * loop + a2][i] += 1;
    }
  }
}
void mul(vector<vector<long long>> &a, vector<vector<long long>> b) {
  vector<vector<long long>> ret(sz, vector<long long>(sz));
  for (int i = 0; i < sz; i++) {
    for (int j = 0; j < sz; j++) {
      for (int k = 0; k < sz; k++) {
        add(ret[i][j], a[i][k] * b[k][j]);
      }
    }
  }
  a = ret;
}
void matpw(vector<vector<long long>> &a, long long b) {
  vector<vector<long long>> ret(sz, vector<long long>(sz));
  for (int i = 0; i < sz; i++) ret[i][i] = 1;
  while (b) {
    if (b & 1) mul(ret, a);
    mul(a, a);
    b >>= 1;
  }
  a = ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i < (1 << 6); i++) {
    for (int j = 0; j < 6; j++) {
      if (i & (1 << j)) cnt[i]++;
    }
  }
  int n, K, m;
  cin >> n >> K >> m;
  sz = (K + 1) * (1 << m);
  vector<vector<long long>> Ma(sz, vector<long long>(sz));
  gao(sz, K + 1, m, Ma);
  matpw(Ma, n);
  vector<vector<long long>> base(sz, vector<long long>(sz));
  for (int i = 0; i < sz; ++i) base[i][0] = 1;
  mul(base, Ma);
  long long ans = 0;
  for (int i = 0; i < (1 << m); ++i) add(ans, base[0][sz - i - 1]);
  cout << ans << endl;
  return 0;
}
