#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long long
//template
std::vector<int> Factorial(1234567);
void Cinit(){
  Factorial[0]=1;
  for(int i=1;i<1234567;i++)Factorial[i]=Factorial[i-1]*i%MOD;
}
//main
signed main(){
  Cinit();
  int N,H,D;cin>>N>>H>>D;
  std::vector<int> wa(1234567);//階乗の累積和
  wa[0]=0;for(int i=1;i<1234567;i++)wa[i]=(wa[i-1]+Factorial[i])%MOD;
  int sum=0;
  queue<int> que;
  for(int i=0;i<=H;i++){
    if(i==0){
      sum+=Factorial[N];
      que.push(sum);
      continue;
    }
    if(que.size()>D){
      int p=que.front();que.pop();
      sum-=p;
      if(sum<0)sum+=MOD;
    }
    if(i==H)cout<<sum<<endl;
    que.push(sum*wa[N]%MOD);
    sum+=sum*wa[N]%MOD;sum%=MOD;
  }
}
