#include<bits/stdc++.h>
#define ll long long
#define uint unsigned int
#define ull unsigned long long
#define inf 1010000000
#define infll 1010000000000000000ll
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define mpr make_pair
#define fi first
#define se second
#define pq priority_queue<int>
#define pqll priority_queue<ll>
#define up(x,y) (x<(y)?x=(y):0)
#define dn(x,y) (x>(y)?x=(y):0)
#define ad(x,y) (x=(x+(y))%mod)
#define cbn(x,y) ((ll)fac[x]*inv[y]%mod*inv[(x)-(y)]%mod)
#define N 5009
#define mod 1000000007
using namespace std;

int read(); ll readll();

int n,A,B,f[N],g[N],h[N];
int main(){
	scanf("%d%d%d",&n,&A,&B);
	if (B>n){ puts("1"); return 0; }
	if (A>n){ puts("2"); return 0; }
	if (A>B) swap(A,B);
	int i,j,ans;
	for (i=ans=1; i<=n; i++) ans=(ans<<1)%mod;
	f[0]=g[0]=1;
	for (i=1; i<B; i++)
		for (j=h[i]=1,f[i]=max(0,i-A); i-j>A; j++){
			ad(h[i],(ll)h[j]*(i-j-A));
			ad(f[i],(ll)f[j]*(i-j-A));
		}
	for (i=1; i<=n; i++)
		for (j=0; j<i; j++){
			ad(f[i],(ll)g[j]*h[i-j]);
			if (i-j<A) ad(g[i],f[j]);	
		}
	for (i=h[0]=1; i<B; i++)
		for (j=h[i]=0; i-j>A; j++)
			ad(h[i],(ll)h[j]*(i-j-A));
	ad(ans,mod-f[n]);
	for (i=0; i<B; i++) ad(ans,mod-(ll)g[n-i]*h[i]%mod);
	printf("%d\n",ans);
	return 0;
}

int read(){
	int x=0; char ch=getchar(); bool flag=0;
	while (ch<'0' || ch>'9'){ if (ch=='-') flag=1; ch=getchar(); }
	while (ch>='0' && ch<='9'){ x=x*10+ch-'0'; ch=getchar(); }
	return flag?-x:x;
}
ll readll(){
	ll x=0; char ch=getchar(); bool flag=0;
	while (ch<'0' || ch>'9'){ if (ch=='-') flag=1; ch=getchar(); }
	while (ch>='0' && ch<='9'){ x=x*10+ch-'0'; ch=getchar(); }
	return flag?-x:x;
}
