#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int mod = 1e9 + 7;
void add(int &x, long long y) {
  y %= mod;
  x = (x + y) % mod;
}
struct Matrix {
  vector<vector<int>> a;
  int n, m;
  Matrix(int n, int m) : n(n), m(m) { a.resize(n, vector<int>(m, 0)); }
  friend Matrix operator*(Matrix a, Matrix b) {
    Matrix c(a.n, b.m);
    for (int i = 0; i < a.n; ++i)
      for (int j = 0; j < b.m; ++j)
        for (int k = 0; k < a.m; ++k)
          add(c.a[i][j], 1LL * a.a[i][k] * b.a[k][j]);
    return c;
  }
  friend Matrix operator^(Matrix a, int x) {
    if (x == 1) return a;
    Matrix tmp = a ^ (x / 2);
    tmp = tmp * tmp;
    if (x & 1) tmp = tmp * a;
    return tmp;
  }
};
int n, m, k;
int id(int x, int y) { return x * (1 << m) + y; }
int main() {
  if (fopen("exam.inp", "r"))
    freopen("exam.inp", "r", stdin), freopen("exam.out", "w", stdout);
  cin >> n >> k >> m;
  Matrix mul((k + 1) * (1 << m), (k + 1) * (1 << m));
  for (int j = 0; j <= k; j++)
    for (int mask = 0; mask < (1 << m); mask++) {
      int oid = id(j, mask), newmask = (mask << 1) & ((1 << m) - 1);
      mul.a[id(j, newmask)][oid] = 1;
      if (j < k)
        mul.a[id(j + 1, newmask | 1)][oid] = (__builtin_popcount(mask) + 1);
    }
  mul = mul ^ n;
  Matrix res((k + 1) * (1 << m), 1);
  res.a[id(0, 0)][0] = 1;
  res = mul * res;
  int ans = 0;
  for (int j = 0; j < (1 << m); j++) add(ans, res.a[id(k, j)][0]);
  cout << ans;
}
