#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using std::deque;
using std::pair;
using std::vector;
template <class T>
T Read() {
  T n = 0;
  char c = getchar();
  bool sign = true;
  while (c < '0' || c > '9') {
    if (c == '-') {
      sign = !sign;
    }
    c = getchar();
  }
  while (c <= '9' && c >= '0') {
    n = n * 10 + c - '0';
    c = getchar();
  }
  return sign ? n : -n;
}
int M = 1e9 + 7;
class Matrix {
 public:
  Matrix(int r, int c) {
    r_ = r;
    c_ = c;
    mat_ = new int *[r];
    for (int i = 0; i < r; i++) {
      mat_[i] = new int[c];
    }
  }
  int *operator[](int i) { return mat_[i]; }
  void asZero() {
    for (int i = 0; i < r_; i++) {
      for (int j = 0; j < c_; j++) {
        mat_[i][j] = 0;
      }
    }
  }
  void asStandard() {
    asZero();
    for (int i = 0; i < r_; i++) {
      mat_[i][i] = 1;
    }
  }
  static Matrix *plus(Matrix *a, Matrix *b) {
    int r = a->r_;
    int c = a->c_;
    Matrix *mat = new Matrix(r, c);
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < r; j++) {
        mat->mat_[i][j] = (a->mat_[i][j] + b->mat_[i][j]) % M;
      }
    }
    return mat;
  }
  static Matrix *mul(Matrix *a, Matrix *b) {
    int r = a->r_;
    int c = b->c_;
    int m = a->c_;
    Matrix *mat = new Matrix(r, c);
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        mat->mat_[i][j] = 0;
        for (int k = 0; k < m; k++) {
          mat->mat_[i][j] =
              (mat->mat_[i][j] + (long long)a->mat_[i][k] * b->mat_[k][j]) % M;
        }
      }
    }
    return mat;
  }
  static bool equal(Matrix *a, Matrix *b) {
    if (a->r_ != b->r_ || a->c_ != b->c_) {
      return false;
    }
    int r = a->r_;
    int c = a->c_;
    for (int i = 0; i < r; i++) {
      for (int j = 0; j < c; j++) {
        if (a->mat_[i][j] != b->mat_[i][j]) {
          return false;
        }
      }
    }
    return true;
  }
  static Matrix *pow(Matrix *x, int n) {
    if (n == 0) {
      Matrix *one = new Matrix(x->r_, x->c_);
      one->asStandard();
      return one;
    }
    Matrix *p = pow(x, n >> 1);
    p = mul(p, p);
    if (n & 1) {
      p = mul(p, x);
    }
    return p;
  }
  void debug() {
    printf("\n");
    for (int i = 0; i < r_; i++) {
      for (int j = 0; j < c_; j++) {
        printf("%d ", mat_[i][j]);
      }
      printf("\n");
    }
  }

 private:
  int **mat_;
  int r_;
  int c_;
};
int BIT_COUNT[1 << 5];
bool test() {
  Matrix a(2, 2);
  Matrix b(2, 2);
  a.asStandard();
  b.asZero();
  b[0][0] = 1;
  b[0][1] = 987213;
  b[1][1] = 3;
  b[1][0] = 9417131;
  ;
  ;
  return true;
}
bool test3() {
  Matrix b(2, 2);
  b.asZero();
  b[0][0] = 1;
  b[0][1] = 987213;
  b[1][1] = 3;
  b[1][0] = 9417131;
  Matrix *c = &b;
  ;
  ;
  return true;
}
bool test2() {
  Matrix b(2, 2);
  b.asZero();
  b[0][0] = 1;
  b[0][1] = 987213;
  b[1][1] = 3;
  b[1][0] = 9417131;
  Matrix *c = new Matrix(2, 2);
  c->asStandard();
  for (int i = 0; i < 10; i++) {
    c = Matrix::mul(c, &b);
  };
  ;
  return true;
}
int main() {
  int n = Read<int>();
  int k = Read<int>();
  int m = Read<int>();
  int mask = 1 << m;
  int highest_bit = mask >> 1;
  BIT_COUNT[0] = 0;
  for (int i = 1; i < mask; i++) {
    BIT_COUNT[i] = BIT_COUNT[i & (i - 1)] + 1;
  }
  int mat_size = (k + 1) * mask;
  Matrix *transition = new Matrix(mat_size, mat_size);
  transition->asZero();
  for (int i = 0; i < mat_size; i++) {
    int step = (i / mask);
    int bit = (i % mask);
    if (BIT_COUNT[bit] > step) {
      continue;
    }
    if (bit & 1) {
      (*transition)[i][((step - 1) * mask + (bit >> 1))] =
          BIT_COUNT[bit >> 1] + 1;
      (*transition)[i][((step - 1) * mask + ((bit >> 1) | highest_bit))] =
          BIT_COUNT[(bit >> 1) | highest_bit] + 1;
    } else {
      (*transition)[i][((step)*mask + (bit >> 1))] = 1;
      (*transition)[i][((step)*mask + ((bit >> 1) | highest_bit))] = 1;
    }
  }
  Matrix *transition_n_times = Matrix::pow(transition, n);
  Matrix *init = new Matrix(mat_size, 1);
  init->asZero();
  (*init)[((0) * mask + (0))][0] = 1;
  init = Matrix::mul(transition_n_times, init);
  int sum = 0;
  for (int i = 0; i < mask; i++) {
    sum = (sum + (*init)[((k)*mask + (i))][0]) % M;
  }
  printf("%d", sum);
  return 0;
}
