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>
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do { (t*=10)+=ch-'0'; ch=getchar(); } while ('0'<=ch&&ch<='9'); t*=f;
}
typedef long long ll;
const int mod=(1e9)+7;
const int maxn=5010;
int n,a,b,dp[maxn][2],f[maxn][2],g[maxn],ans,tmp;
int ksm(int x,int y) {
	int res=1;
	while (y) {
		if (y&1) res=(ll)res*x%mod;
		x=(ll)x*x%mod; y>>=1;
	} return res;
}
void update(int &x,int y) {
	x+=y; if (x>=mod) x-=mod;
}
int main() {
//	freopen("1.txt","r",stdin);
	read(n); read(a); read(b);
	if (a>b) swap(a,b);
	if (b==1) { printf("%d\n",ksm(2,n)); return 0; }
	f[0][0]=f[0][1]=1;
	for (int i=1;i<=n;i++)
	for (int k=0;k<=1;k++)
	for (int j=1;j<=i;j++) {
		if (!k&&j<a) continue;
		update(f[i][k],f[i-j][k^1]);
	}
	g[0]=1;
	for (int i=1;i<=n;i++) g[i]=(f[i][0]+f[i][1])%mod;
	//for (int i=1;i<=n;i++) printf("%d ",g[i]); printf("\n");
	for (int i=1;i<n;i++) {
		if (i<a) update(dp[i][0],1);
		for (int j=1;j<min(i,a);j++) update(dp[i][0],dp[i-j][1]);
		
		if (i<b) update(dp[i][1],g[i-1]);
		for (int j=1;j<min(i,b);j++) {
			if (j==1) update(dp[i][1],dp[i-j][0]);
			else update(dp[i][1],(ll)dp[i-j][0]*g[j-2]%mod);
		}
		
		if (n-i<b) update(ans,(ll)dp[i][0]*g[n-i-1]%mod);
		if (n-i<a) update(ans,(ll)dp[i][1]);
	//	printf("%d %d %d\n",i,dp[i][0],dp[i][1],ans);
	}
//	printf("%d %d\n",ksm(2,n),ans);
	printf("%d\n",(ksm(2,n)-ans+mod)%mod);
	return 0;
}
/*
  0. Enough array size? Enough array size? Enough array size? Interger overflow?
  
  1. Think TWICE, Code ONCE!
  Are there any counterexamples to your algo?
    
  2. Be careful about the BOUNDARIES!
  N=1? P=1? Something about 0?
    
  3. Do not make STUPID MISTAKES!
  Time complexity? Memory usage? Precision error?
*/