#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr int kMaxN = 1e5 + 3;
constexpr int kMaxM = 4;
constexpr int kMaxK = 14;
int bits[1 << kMaxM];
int dp[kMaxN][kMaxK][1 << kMaxM];
void add_self(int& a, ll b) { a = (a + b) % mod; }
struct Matrix {
  vector<vector<int>> a;
  int n, m;
  Matrix(int rows, int cols) : n{rows}, m{cols} {
    a = vector<vector<int>>(n, vector<int>(m));
  }
  Matrix(int n) : Matrix(n, n) {
    for (int i = 0; i < n; ++i) {
      a[i][i] = 1;
    }
  }
  Matrix operator*(const Matrix& other) const {
    assert(m == other.n);
    Matrix res(n, other.m);
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < other.m; ++j) {
        for (int k = 0; k < m; ++k) {
          add_self(res.a[i][j], 1LL * a[i][k] * other.a[k][j]);
        }
      }
    }
    return res;
  }
};
void pow(Matrix a, int b, Matrix& state) {
  while (b) {
    if (b & 1) {
      state = a * state;
    }
    if (b > 1) {
      a = a * a;
    }
    b /= 2;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k, m;
  cin >> n >> k >> m;
  for (int i = 1; i < (1 << kMaxM); ++i) {
    bits[i] = __builtin_popcount(i);
  }
  int sz = (k + 1) * (1 << m);
  auto id = [&](int l, int mask) { return l * (1 << m) + mask; };
  Matrix rec(sz, sz);
  for (int l = 0; l <= k; ++l) {
    for (int mask = 0; mask < (1 << m); ++mask) {
      int new_mask = (mask << 1) % (1 << m);
      rec.a[id(l, new_mask)][id(l, mask)] += 1;
      if (l < k) {
        rec.a[id(l + 1, new_mask | 1)][id(l, mask)] += bits[mask] + 1;
      }
    }
  }
  Matrix state(sz, 1);
  state.a[0][0] = 1;
  pow(rec, n, state);
  ll total = 0;
  for (int mask = 0; mask < (1 << m); ++mask) {
    total += state.a[id(k, mask)][0];
  }
  cout << total % mod << '\n';
  return 0;
}
