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 pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) //cerr << #x << " : " << x << '\n'

using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ll Mod = 1000000007LL;
const int N = 6000;
const ll Inf = 2242545357980376863LL;
const ll Log = 30;

ll mul(ll a, ll b){
	return (a * b) % Mod;
}

ll dp[N], dp1[N];
ll dpc[N], dpm[N];
ll fdp[N][3];

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n, A, B;
	cin >> n >> A >> B;
	if(A > B) swap(A, B);

	//dp[0] = 1;
	for(int i = 1; i <= n; i++){
		dp[i] = 1;
		for(int j = A + 1; j <= i; j++) dp[i] += (1ll * dp[i - j] * (j - A)) % Mod;
		dp[i] %= Mod;
		//cerr << i << ' ' << dp[i] << '\n';
	}
	cerr << '\n';
	for(int i = 1; i <= n; i++){
		for(int j = A; j < i; j++) dp1[i] += dp[i - j];
		dp1[i] %= Mod;
	}
	for(int i = 1; i <= n; i++){
		for(int j = 1; j < min(A, i); j++){
			if(i - j >= B) dpc[i] += dp[i - j];
		}
		dpc[i] %= Mod;
	}
	for(int i = 1; i <= n; i++){
		for(int j = 1; j < min(A, i); j++){
			dpm[i] += dp[i - j];
		}
		dpm[i] %= Mod;
	}
	ll ans = 1;
	for(int i = 0; i <= n; i++){
		for(int j = 0; j + i < n; j++) if((i == 0 || i >= A) && (j == 0 || j >= A)) ans += dp[n - i - j];
	}
	ans %= Mod;
	debug(ans);
	debug(dp[3]);
	for(int i = 1; i <= n; i++){
		//fdp[i][1] += 0;
		if(i < A) fdp[i][0] += 1;
		for(int j = 1; j <= min(A - 1, i - 1); j++){
			if(i - j < B) fdp[i][0] += dp[i - j];
			else fdp[i][1] += dp[i - j];
		}
		for(int j = 1; j <= min(A - 1, i - 1); j++){
			if(i - j >= B) fdp[i][1] += dp1[i - j];
			else fdp[i][0] += dp1[i - j];
		}
		if(i + B > n) fdp[i][0] = 0;
		fdp[i][0] %= Mod;
		fdp[i][1] %= Mod;	
		
		//cerr << i << ' ' << fdp[i][0] << ' ' << fdp[i][1] << '\n';

		for(int ln = 1; ln + i <= n; ln ++){
			for(int k = 0; k < 2; k++){
				for(int k2 = k; k2 < 2; k2 ++){
					( fdp[i + ln][k2] += 1ll * fdp[i][k] * (k == k2 ? (k == 0 ? dpm[ln] - dpc[ln] + Mod : dpm[ln]) : dpc[ln]) ) %= Mod;
				}
			}
		}
		ans += (fdp[i][0] + fdp[i][1]) * (i < n ? (dp1[n - i] + dp[n - i]) : 1);
		ans %= Mod;
	}
	debug(dpc[3]);
	cout << ans % Mod << '\n';
	return 0;
}
/*
4 2 2

*/