Snuke has a string x of length N. Initially, every character in x is `0`.

Snuke can do the following two operations any number of times in any order:

* Choose A consecutive characters in x and replace each of them with `0`.
* Choose B consecutive characters in x and replace each of them with `1`.



Find the number of different strings that x can be after Snuke finishes doing operations. This count can be enormous, so compute it modulo (10^9+7).

Constraints

* 1 \leq N \leq 5000
* 1 \leq A,B \leq N
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N A B


Output

Print the number of different strings that x can be after Snuke finishes doing operations, modulo (10^9+7).

Examples

Input

4 2 3


Output

11


Input

10 7 2


Output

533


Input

1000 100 10


Output

828178524
#include<bits/stdc++.h>
#define ll long long
#define lld long double
using namespace std;
template<typename tn> void read(tn &a){
	tn x=0,f=1; char c=' ';
	for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
	for(;isdigit(c);c=getchar()) x=x*10+c-'0';
	a=x*f;
}
const int N = 101000,mod = 1e9+7;
ll ans;
int n,A,B;
int f[2][5010][2][2];
int s[5010][5010][2],sum[5010][2];
int main(){
	read(n);read(A);read(B);
	if(A<B) swap(A,B);
	s[0][0][0]=1;
	f[0][0][0][0]=1;
	sum[0][0]=1;
	for(int i=1;i<=n;i++){
		int now=i&1,lst=i-1&1;
		memset(f[now],0,sizeof(f[now]));
		for(int j=0;j<=i;j++) s[i][j][0]=s[i-1][j][0],s[i][j][1]=s[i-1][j][1];
		sum[i][0]=sum[i-1][0];sum[i][1]=sum[i-1][1];
		for(int j=0;j<=i;j++){
			if(i-j<A){
				f[now][j][0][0]=(f[lst][j][0][0]+f[lst][j][1][0])%mod;
				f[now][j][0][1]=(f[lst][j][0][1]+f[lst][j][1][1])%mod;
				if(i-j<B){
					if(i==j){
						f[now][j][1][0]=sum[i-1][0]-(i>=B?sum[i-B][0]:0);
						f[now][j][1][1]=sum[i-1][1]-(i>=B?sum[i-B][1]:0);
					}
				}
				else{
					f[now][j][1][1]=s[i-B][j][1];
					f[now][j][1][0]=s[i-B][j][0];
				}
			}
			else{
				f[now][j][0][1]=(0ll+f[lst][j][0][0]+f[lst][j][0][1]+f[lst][j][1][0]+f[lst][j][1][1])%mod;
				if(i>=B)
					f[now][j][1][1]=(s[i-B][j][0]+s[i-B][j][1])%mod;
			}
		//	cerr<<i<<' '<<j<<' '<<f[now][j][0][0]<<' '<<f[now][j][0][1]<<' '<<f[now][j][1][0]<<' '<<f[now][j][1][1]<<'\n';
			sum[i][0]=(sum[i][0]+f[now][j][0][0])%mod;
			sum[i][1]=(sum[i][1]+f[now][j][0][1])%mod;
			s[i][j][0]=(s[i][j][0]+f[now][j][0][0])%mod;
			s[i][j][1]=(s[i][j][1]+f[now][j][0][1])%mod;
			if(i==n) ans=(ans+f[now][j][0][1]+f[now][j][1][1])%mod;
		}
	}
	cout<<(ans+mod)%mod<<'\n';
	return 0;
}

