This problem is same as the previous one, but has larger constraints.

Aki is playing a new video game. In the video game, he will control Neko, the giant cat, to fly between planets in the Catniverse.

There are n planets in the Catniverse, numbered from 1 to n. At the beginning of the game, Aki chooses the planet where Neko is initially located. Then Aki performs k - 1 moves, where in each move Neko is moved from the current planet x to some other planet y such that:

  * Planet y is not visited yet. 
  * 1 ≤ y ≤ x + m (where m is a fixed constant given in the input) 



This way, Neko will visit exactly k different planets. Two ways of visiting planets are called different if there is some index i such that, the i-th planet visited in the first way is different from the i-th planet visited in the second way.

What is the total number of ways to visit k planets this way? Since the answer can be quite large, print it modulo 10^9 + 7.

Input

The only line contains three integers n, k and m (1 ≤ n ≤ 10^9, 1 ≤ k ≤ min(n, 12), 1 ≤ m ≤ 4) — the number of planets in the Catniverse, the number of planets Neko needs to visit and the said constant m.

Output

Print exactly one integer — the number of different ways Neko can visit exactly k planets. Since the answer can be quite large, print it modulo 10^9 + 7.

Examples

Input


3 3 1


Output


4


Input


4 2 1


Output


9


Input


5 5 4


Output


120


Input


100 1 2


Output


100

Note

In the first example, there are 4 ways Neko can visit all the planets:

  * 1 → 2 → 3 
  * 2 → 3 → 1 
  * 3 → 1 → 2 
  * 3 → 2 → 1 



In the second example, there are 9 ways Neko can visit exactly 2 planets:

  * 1 → 2 
  * 2 → 1 
  * 2 → 3 
  * 3 → 1 
  * 3 → 2 
  * 3 → 4 
  * 4 → 1 
  * 4 → 2 
  * 4 → 3 



In the third example, with m = 4, Neko can visit all the planets in any order, so there are 5! = 120 ways Neko can visit all the planets.

In the fourth example, Neko only visit exactly 1 planet (which is also the planet he initially located), and there are 100 ways to choose the starting planet for Neko.
#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 k = 0; k < (n); ++k) {
      if (a[i][k])
        for (int j = 0; j < (n); ++j) {
          {
            long long tmp = (long long)a[i][k] * b[k][j];
            if (tmp >= MOD) tmp %= MOD;
            add(c[i][j], (int)tmp);
          }
        }
    }
  }
  int byteSize = sizeof(a[0][0]) * n;
  for (int i = 0; i < (n); ++i) {
    memcpy(a + i, c + i, byteSize);
  }
}
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;
}
