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 MOD = 1e9 + 7;
const long long MAXN = 10 + 5;
const long long INF = 1e18;
const long double PI = acos((long double)-1);
long long mat2[300][300];
vector<vector<long long> > mult(vector<vector<long long> > m1,
                                vector<vector<long long> > m2, long long rc,
                                long long mod) {
  vector<vector<long long> > newvec;
  for (long long i = (0); i <= (rc - 1); i++) {
    newvec.push_back(vector<long long>());
    for (long long j = (0); j <= (rc - 1); j++) {
      newvec[i].push_back(0);
    }
  }
  for (long long i = (0); i <= (rc - 1); i++) {
    for (long long j = (0); j <= (rc - 1); j++) {
      for (long long k = (0); k <= (rc - 1); k++) {
        newvec[i][j] += m1[i][k] * m2[k][j];
        newvec[i][j] %= mod;
      }
    }
  }
  return newvec;
}
vector<vector<long long> > ex(vector<vector<long long> > base, long long power,
                              long long mod, long long rc) {
  vector<vector<long long> > res;
  for (long long i = (0); i <= (rc - 1); i++) {
    res.push_back(vector<long long>());
    for (long long j = (0); j <= (rc - 1); j++) {
      if (i == j)
        res[i].push_back(1);
      else
        res[i].push_back(0);
    }
  }
  while (power) {
    if (power & 1) res = mult(res, base, rc, mod);
    base = mult(base, base, rc, mod);
    power >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, k, m;
  cin >> n >> k >> m;
  long long masks = 1ll << m;
  long long sz = (k + 1) * masks;
  long long cnt = 0;
  for (long long j = (0); j <= (k); j++) {
    for (long long mask = (0); mask <= (masks - 1); mask++) {
      long long newmask = (mask << 1) % (1 << m);
      long long newindex;
      if (j < k) {
        newindex = (j + 1) * masks + (newmask | 1);
        mat2[newindex][cnt] += __builtin_popcountll(mask) + 1;
      }
      newindex = j * masks + newmask;
      mat2[newindex][cnt]++;
      cnt++;
    }
  }
  vector<vector<long long> > v;
  for (long long i = (0); i <= (sz - 1); i++) {
    v.push_back(vector<long long>());
    for (long long j = (0); j <= (sz - 1); j++) v[i].push_back(mat2[i][j]);
  }
  vector<vector<long long> > final = ex(v, n, MOD, sz);
  long long ans = 0, startid = k * masks;
  for (long long i = (startid); i <= (sz - 1); i++) {
    ans += final[i][0];
    ans %= MOD;
  }
  cout << ans;
}
