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;

typedef long long lint;
typedef long double louble;

#define so(a) ((int)((a).size()))

template<typename T1,typename T2> inline T1 max(T1 a,T2 b){return a<b?b:a;}
template<typename T1,typename T2> inline T1 min(T1 a,T2 b){return a<b?a:b;}

const char lf = '\n';

namespace ae86
{
	const int bufl = 1 << 15;

	char buf[bufl],*s=buf,*t=buf;

	inline int fetch()
	{
		if(s==t){t=(s=buf)+fread(buf,1,bufl,stdin);if(s==t)return EOF;}
		return *s++;
	}

	inline int ty()
	{
		int a=0;int b=1,c=fetch();
		while(!isdigit(c))b^=c=='-',c=fetch();
		while(isdigit(c))a=a*10+c-48,c=fetch();
		return b?a:-a;
	}
}
using ae86::ty;

const int _ = 5007 , mo = 1000000007;

inline int upd(int x){return x+((x>>31)&mo);}
inline lint upd(lint x){return x+((x>>63)&mo);}
template<typename T1,typename T2> inline T1 ad(T1 &a,T2 b){return a=upd(a+b-mo);}
template<typename T1,typename T2> inline T1 dl(T1 &a,T2 b){return a=upd(a-b);}
template<typename T1,typename T2> inline T1 add(T1 a,T2 b){return upd(a+b-mo);}
template<typename T1,typename T2> inline T1 del(T1 a,T2 b){return upd(a-b);}

int n,pa,pb;
lint f[_][_][2]={0},sf[_][2]={0},g[_][_][2]={0};

int main()
{
	ios_base::sync_with_stdio(0),cout.tie(nullptr);

	n=ty(),pa=ty(),pb=ty();

	if(pa<pb)swap(pa,pb);

	f[0][0][0]=sf[0][0]=g[0][0][0]=1;
	f[0][0][1]=sf[0][1]=g[0][0][1]=1;

	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<pa;j++)
		{
			if(i>=1 && j>=1)ad(f[i][j][0],g[i-1][j-1][1]);
			if(i>=pb && j>=pb)ad(f[i][j][1],g[i-pb][j-pb][0]);
		}
		for(int j=1;j<=min(i,pb-1);j++)ad(f[i][0][1],sf[i-j][0]);

		g[i][0][1]=f[i][0][1];
		for(int j=1;j<pa;j++)
		{
			g[i][j][0]=add(g[i-1][j-1][0],f[i][j][0]);
			g[i][j][1]=add(g[i-1][j-1][1],f[i][j][1]);
		}

		for(int j=0;j<pa;j++)ad(sf[i][0],f[i][j][0]),ad(sf[i][1],f[i][j][1]);
	}

	lint ans=1;
	for(int i=1;i<=n;i++)ad(ans,ans);
	for(int i=0;i<pa;i++)
		for(int j=0;j<2;j++)
			dl(ans,f[n][i][j]);
	cout<<ans<<lf;
	
	return 0;
}
