#include<bits/stdc++.h>
using namespace std;

int main() {
  long long N,H,D;
  cin >> N >> H >> D;
  vector<long long> dp(H,0);
  vector<long long> totdp(H,0);
  long long ii = 1;
  long long ic;
  long long iii = 0;
  for (int i=1; i<N+1; i++) {
    ic = i;
    ii *= ic;
    ii %= 1000000007;
    iii += ii;
    iii %= 1000000007;
  }
  dp[0] = ii;
  totdp[0] = ii;
  
  cerr << ii << endl;
  for (int i=1; i<H; i++) {
      
    dp[i] = totdp[i-1];
    if (i > D) {
      dp[i] += 1000000007;
      dp[i] -= totdp[i-D-1];
    }
    dp[i] %= 1000000007;
    dp[i] *= iii;
    dp[i] %= 1000000007;
    totdp[i] = totdp[i-1] + dp[i];
    totdp[i] %= 1000000007;
    cerr << dp[i] << endl;
  }
  
  long long ans = totdp[H-1];
  ans += 1000000007;
  if (H > D) {
    ans -= totdp[H-D-1];
  }
  ans %= 1000000007;
  cout << ans << endl;
    
  cerr << iii;
  
  return 0;
}