#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
  in >> p.first >> p.second;
  return in;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &v) {
  for (auto &x : v) in >> x;
  return in;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const std::pair<T1, T2> &p) {
  out << "[" << p.first << ", " << p.second << "]"
      << "\n";
  return out;
}
inline int gc() {
  static const int BUF = 1e7;
  static char buf[BUF], *bg = buf + BUF, *ed = bg;
  if (bg == ed) fread(bg = buf, 1, BUF, stdin);
  return *bg++;
}
inline int ri() {
  int x = 0, f = 1, c = gc();
  for (; c < 48 || c > 57; f = c == '-' ? -1 : f, c = gc())
    ;
  for (; c > 47 && c < 58; x = x * 10 + c - 48, c = gc())
    ;
  return x * f;
}
const double EPS = 1e-10;
const long long inf = 0x7fffffff;
const long long infLL = 0x7fffffffffffffffLL;
const long long mod = 1e9 + 7;
const int maxN = 1e5 + 7;
const long long ONE = 1;
const long long evenBits = 0xaaaaaaaaaaaaaaaa;
const long long oddBits = 0x5555555555555555;
void add_mod(long long &a, long long b) { a = (a + b) % mod; }
struct Matrix {
  int row, col;
  long long MOD;
  vector<vector<long long> > mat;
  Matrix(int r, int c, long long p = mod) : row(r), col(c), MOD(p) {
    mat.assign(r, vector<long long>(c, 0));
  }
  Matrix(const Matrix &x, long long p = mod) : MOD(p) {
    mat = x.mat;
    row = x.row;
    col = x.col;
  }
  Matrix(const vector<vector<long long> > &A, long long p = mod) : MOD(p) {
    mat = A;
    row = A.size();
    col = A[0].size();
  }
  inline void E(int x = 1) {
    assert(row == col);
    for (int i = 0; i < (row); ++i) mat[i][i] = x;
  }
  inline vector<long long> &operator[](int x) {
    assert(x >= 0 && x < row);
    return mat[x];
  }
  inline Matrix operator=(const vector<vector<long long> > &x) {
    row = x.size();
    col = x[0].size();
    mat = x;
    return *this;
  }
  inline Matrix operator+(const Matrix &x) {
    assert(row == x.row && col == x.col);
    Matrix ret(row, col);
    for (int i = 0; i < (row); ++i) {
      for (int j = 0; j < (col); ++j) {
        ret.mat[i][j] = mat[i][j] + x.mat[i][j];
        ret.mat[i][j] %= MOD;
      }
    }
    return ret;
  }
  inline Matrix operator*(const Matrix &x) {
    assert(col == x.row);
    Matrix ret(row, x.col);
    for (int k = 0; k < (x.col); ++k) {
      for (int i = 0; i < (row); ++i) {
        if (mat[i][k] == 0) continue;
        for (int j = 0; j < (x.col); ++j) {
          ret.mat[i][j] += mat[i][k] * x.mat[k][j];
          ret.mat[i][j] %= MOD;
        }
      }
    }
    return ret;
  }
  inline Matrix operator*=(const Matrix &x) { return *this = *this * x; }
  inline Matrix operator+=(const Matrix &x) { return *this = *this + x; }
  inline void print() {
    for (int i = 0; i < (row); ++i) {
      for (int j = 0; j < (col); ++j) {
        cout << mat[i][j] << " ";
      }
      cout << endl;
    }
  }
};
inline Matrix mat_pow_mod(Matrix x, long long y) {
  Matrix ret(x.row, x.col);
  ret.E();
  while (y) {
    if (y & 1) ret *= x;
    x *= x;
    y >>= 1;
  }
  return ret;
}
int n, k, m, maxSta;
long long ans;
int toId(int j, int sta) { return j * maxSta + sta; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k >> m;
  maxSta = 1 << m;
  Matrix dp((k + 1) * maxSta, 1);
  dp.mat[0][0] = 1;
  Matrix base((k + 1) * maxSta, (k + 1) * maxSta);
  for (int j = 0; j < (k + 1); ++j) {
    for (int sta = 0; sta < (maxSta); ++sta) {
      int newsta = (sta << 1) % maxSta;
      int cur = toId(j, sta), newcur = toId(j, newsta);
      base.mat[newcur][cur] = 1;
      if (j < k) {
        newcur = toId(j + 1, newsta | 1);
        base.mat[newcur][cur] = __builtin_popcount(sta) + 1;
      }
    }
  }
  base = mat_pow_mod(base, n);
  dp = base * dp;
  for (int sta = 0; sta < (maxSta); ++sta)
    add_mod(ans, dp.mat[toId(k, sta)][0]);
  cout << ans << endl;
  return 0;
}
