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 ld long double
#define ll long long
#define st first
#define nd second
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define pb push_back
using namespace std;
const int N = 5e3+5;
const ll mod = 1e9+7;
ll cover[N][2], sum_cover[N], sum_cover1[N];
ll dp[N][N], col[N], col_suf[N][N];
ll fpow(ll a, ll p) {
	if(p==0) return 1;
	ll b = fpow(a, p/2);
	if(p%2==0) {
		return b*b%mod;
	}
	return b*b%mod*a%mod;
}
int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n, a, b;
	cin>>n>>a>>b;
	if(a < b) swap(a, b);
	ll ans=0;
	cover[0][0] = 1;
	for(int i=1; i<=a; ++i) {
		cover[i][0] = (cover[i-1][0] + cover[i-1][1])%mod;
		cover[i][1] = cover[i-1][1];
		if(i-b >=0 ) {
			cover[i][1] += cover[i-b][0];
			cover[i][1] %= mod;
		}
	}
	for(int i=b-1; i>=1; --i) {
		sum_cover[i] = sum_cover[i+1];
		sum_cover[i] += cover[a-1-i][0];
		sum_cover[i] %= mod;
		sum_cover1[i] = sum_cover1[i+1];
		sum_cover1[i] += cover[a-1-i][0] + cover[a-1-i][1];
		sum_cover1[i] %= mod;
	}
	dp[0][0] = 1;
	dp[1][0] = 1;
	col_suf[0][0] = 1;
	col_suf[0][1] = 2;
	// bug in dp probably
	for(int i=2; i<=n; ++i) { // row - index
		for(int k=0; k<i-1; ++k) { // column - .st pos <b
			if(i-k < a) dp[i][k] = dp[i-1][k];	
			if(i-b-1 >= 0 && i-k < a) dp[i][k] += col_suf[k][i-b-1];
			dp[i][k] %= mod;
			dp[i][i-1] += (col_suf[k][i-1] - ((i-b-1<0)?0:col_suf[k][i-b-1]) - dp[i-1][k] + 2*mod)%mod;
			dp[i][i-1] %= mod;
			col_suf[k][i] = (col_suf[k][i-1] + dp[i][k] ) % mod;
		}
		col_suf[i-1][i] = dp[i][i-1];
	}
	/*cout<<"debug dp: \n";
	for(int i=0; i<=n; ++i) {
		for(int j=0; j<=n; ++j) {
			cout<<dp[i][j]<<' ';
		}
		cout<<'\n';
	}
	cout<<"computing answer\n";*/
	for(int i=1; i<=n-a+1; ++i) {
		int l = n-(i+a-1)+1;
		ans += fpow(2, i-1) * ((i+a-1<n)?cover[a][0]:cover[a][0]+cover[a][1]) % mod
		* dp[l][l-1] % mod;
		ans %= mod;
		//cerr<<i<<' '<<i+a-1<<'\n';
		//cerr<<fpow(2, i-1)<<' '<<((i+a-1<n)?cover[a][0]:cover[a][0]+cover[a][1])<<' '<<dp[l][l-1]<<'\n';
		for(int j=i+a; j<=n; ++j) {
			if(j-i+1 > a+b-1) break;
			l = n-j+1;
			//ans += fpow(2, i-1) * ((j<n)?sum_cover[max(1, b-(j-(i+a-1)))]:
			//sum_cover1[max(1, b-(j-(i+a-1)))])% mod
			//* dp[l][l-1] % mod;
			//ans %= mod;
			//cerr<<i<<' '<<j<<'\n';
			//cerr<<fpow(2, i-1)<<' '<<sum_cover[max(1, b-(j-(i+a-1)))]<<' '<<dp[l][l-1]<<'\n';
			ans += fpow(2, i-1) * ((j<n)?cover[j-i-b][0]:cover[j-i-b][0]+cover[j-i-b][1])%mod* dp[l][l-1]%mod;
//			cerr<<i<<' '<<j<<' '<<fpow(2, i-1)<<' '<<cover[j-i-b][0]
		}
	}
	cout<<ans;
}
