#include <bits/stdc++.h>
using namespace std;
const int N = 13 * 16, Mod = 1e9 + 7;
struct Matrix {
  int n, m, A[N][N];
  inline Matrix(int _n, int _m) : n(_n), m(_m) { memset(A, 0, sizeof(A)); }
  inline Matrix operator*(Matrix &X) {
    Matrix R(n, X.m);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < X.m; j++)
        for (int k = 0; k < m; k++)
          R.A[i][j] = (R.A[i][j] + 1LL * A[i][k] * X.A[k][j]) % Mod;
    return R;
  }
  inline Matrix operator^(long long pw) {
    Matrix R(n, n), T = *this;
    for (int i = 0; i < n; i++) R.A[i][i] = 1;
    for (; pw; pw >>= 1, T = T * T)
      if (pw & 1) R = R * T;
    return R;
  }
  inline int *operator[](int id) { return A[id]; }
};
int n, k, m;
inline int Getid(int i, int j) { return (i + j * (k + 1)); }
int main() {
  scanf("%d%d%d", &n, &k, &m);
  Matrix A((k + 1) << m, (k + 1) << m);
  for (int i = 0; i <= k; i++)
    for (int j = 0; j < (1 << m); j++) {
      A[Getid(i, j)][Getid(i, j >> 1)] = 1;
      if (i < k)
        A[Getid(i, j)][Getid(i + 1, (j >> 1) | (1 << m - 1))] =
            __builtin_popcount(j) + 1;
    }
  A = A ^ n;
  int tot = 0;
  for (int j = 0; j < (1 << m); j++)
    tot = (tot + A[Getid(0, 0)][Getid(k, j)]) % Mod;
  return !printf("%d", tot);
}
