#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000;
const int MAXN = 1 << 20;
const long long MOD = 1e9 + 7;
template <typename T>
void chmin(T &a, T b) {
  if (a > b) a = b;
}
template <typename T>
void chmax(T &a, T b) {
  if (a < b) a = b;
}
template <typename T>
void add(T &a, T b) {
  a += b;
  if (a < 0) a += MOD;
  if (a >= MOD) a -= MOD;
}
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
double din() {
  double x;
  scanf("%lf", &x);
  return x;
}
long long p2[64];
void initP2() {
  p2[0] = 1;
  for (int i = (1); i <= (63); ++i) {
    p2[i] = p2[i - 1] * 2;
  }
}
int countBitsBaseB(long long n, long long b) {
  if (n == 0) return 1;
  int ret = 0;
  while (n) {
    ret++;
    n /= b;
  }
  return ret;
}
int count1(long long n) {
  int ret = 0;
  while (n) {
    ret += n & 1;
    n >>= 1;
  }
  return ret;
}
long long c[1024][1024] = {0};
void initC() {
  for (int i = 0; i < (1024); ++i) {
    for (int j = 0; j < (i + 1); ++j) {
      if (j == 0 || j == i) {
        c[i][j] = 1;
      } else {
        c[i][j] = c[i - 1][j - 1];
        add(c[i][j], c[i - 1][j]);
      }
    }
  }
}
void init() {
  initP2();
  initC();
}
void mul(int a[(1 << 8)][(1 << 8)], int b[(1 << 8)][(1 << 8)], int n) {
  int c[(1 << 8)][(1 << 8)] = {0};
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (n); ++j) {
      long long tmp = 0;
      for (int k = 0; k < (n); ++k) {
        tmp += (long long)a[i][k] * b[k][j] % MOD;
      }
      c[i][j] = tmp % MOD;
    }
  }
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (n); ++j) {
      a[i][j] = c[i][j];
    }
  }
}
int mat[(1 << 8)][(1 << 8)];
int ret[(1 << 8)][(1 << 8)];
int pos(int x, int y, int n) { return x * n + y; }
int main() {
  init();
  int n = in();
  int f = in();
  int m = in();
  memset((mat), (0), sizeof((mat)));
  memset((ret), (0), sizeof((ret)));
  const int matSize = (f + 1) * p2[m];
  for (int i = 0; i < (matSize); ++i) {
    ret[i][i] = 1;
  }
  for (int i = 0; i < (f + 1); ++i) {
    for (int j = 0; j < (p2[m]); ++j) {
      const int to = pos(i, j, p2[m]);
      int from = pos(i, (j << 1) & (p2[m] - 1), p2[m]);
      mat[from][to]++;
      if (i + 1 <= f) {
        from = pos(i + 1, ((j << 1) | 1) & (p2[m] - 1), p2[m]);
        mat[from][to] += 1 + count1(j);
      }
    }
  }
  while (n) {
    if (n & 1) {
      mul(ret, mat, matSize);
    }
    mul(mat, mat, matSize);
    n >>= 1;
  }
  long long ans = 0;
  for (int i = 0; i < (p2[m]); ++i) {
    ans += ret[pos(f, i, p2[m])][pos(0, 0, p2[m])];
  }
  cout << ans % MOD << endl;
  return 0;
}
