#include<iostream>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<algorithm>
#include<string>
#include<map>
#include<queue>
#include<vector>
#include<stack>
#define ll long long
#define maxn 4001000
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define rep(i,a,b) for(int i=a;i<=b;i++)
const ll P=1e9+7;
using namespace std;
ll n,m,k,f[1010000][4];
ll calc(ll m,ll k)
{
f[0][0]=1;f[0][1]=f[0][2]=0;
for(int i=1;i<=n;i++)
{
ll sum=(f[i-1][0]+f[i-1][1]+f[i-1][2]) %P;
f[i][2]=sum;
if(i<=m) f[i][0]=sum;
else if(i==m+1) f[i][0]=(sum-1)%P;
else f[i][0]=(sum-f[i-m-1][1]-f[i-m-1][2])%P;
if(i<=k) f[i][1]=sum;
else if(i==k+1) f[i][1]=(sum-1)%P;
else f[i][1]=(sum-f[i-k-1][0]-f[i-k-1][2])%P;
}
return (f[n][0]+f[n][1]+f[n][2])%P;
}
int main()
{
while(scanf("%lld%lld%lld",&n,&m,&k)!=EOF)
{
printf("%lld\n",((calc(n,k)-calc(m-1,k))%P+P)%P);
}
}