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 T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
using Int = long long;
const char newl = '\n';


template<typename T,T MOD = 1000000007>
struct Mint{
  static constexpr T mod = MOD;
  T v;
  Mint():v(0){}
  Mint(signed v):v(v){}
  Mint(long long t){v=t%MOD;if(v<0) v+=MOD;}

  Mint pow(long long k){
    Mint res(1),tmp(v);
    while(k){
      if(k&1) res*=tmp;
      tmp*=tmp;
      k>>=1;
    }
    return res;
  }

  static Mint add_identity(){return Mint(0);}
  static Mint mul_identity(){return Mint(1);}

  Mint inv(){return pow(MOD-2);}

  Mint& operator+=(Mint a){v+=a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator-=(Mint a){v+=MOD-a.v;if(v>=MOD)v-=MOD;return *this;}
  Mint& operator*=(Mint a){v=1LL*v*a.v%MOD;return *this;}
  Mint& operator/=(Mint a){return (*this)*=a.inv();}

  Mint operator+(Mint a) const{return Mint(v)+=a;}
  Mint operator-(Mint a) const{return Mint(v)-=a;}
  Mint operator*(Mint a) const{return Mint(v)*=a;}
  Mint operator/(Mint a) const{return Mint(v)/=a;}

  Mint operator-() const{return v?Mint(MOD-v):Mint(v);}

  bool operator==(const Mint a)const{return v==a.v;}
  bool operator!=(const Mint a)const{return v!=a.v;}
  bool operator <(const Mint a)const{return v <a.v;}

  static Mint comb(long long n,int k){
    Mint num(1),dom(1);
    for(int i=0;i<k;i++){
      num*=Mint(n-i);
      dom*=Mint(i+1);
    }
    return num/dom;
  }
};
template<typename T,T MOD> constexpr T Mint<T, MOD>::mod;
template<typename T,T MOD>
ostream& operator<<(ostream &os,Mint<T, MOD> m){os<<m.v;return os;}

//INSERT ABOVE HERE
const int MAX = 5050;
using M = Mint<int>;
M dp[MAX][MAX]={};
M sm[MAX][MAX]={};

M ac[MAX]={};
M query(int x,int y){
  if(x<=0) x=0;
  return ac[y]-ac[x];
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  int n,a,b;
  cin>>n>>a>>b;
  if(!(a<=b)) swap(a,b);

  M ans{0};
  dp[0][0]=1;
  sm[0][0]=1;
  ac[1]=1;
  for(int i=1;i<=n;i++){
    // [i-a, i-1)
    dp[i][1]+=query(i-a,i-1);

    for(int j=0;j<=i;j++){
      // put '1'
      if(i>=1 and j>=1)
        dp[i][j]+=dp[i-1][j-1];

      // put '0'*k '1'
      if(i>=(a+1) and j>=(a+1))
        dp[i][j]+=sm[i-(a+1)][j-(a+1)];
    }

    ac[i+1]=ac[i];
    for(int j=0;j<b;j++){
      ac[i+1]+=dp[i][j];

      // put '0' * (n-i)
      if(i<n and (((n-i)<a) or (j+(n-i)<b))) ans+=dp[i][j];

      // accumulate
      sm[i][j]=((i-1>=0 and j-1>=0)?sm[i-1][j-1]:M(0))+dp[i][j];
    }

    // reset
    for(int j=b;j<=n;j++) dp[i][j]=0;
  }

  for(int j=0;j<b;j++)
    ans+=dp[n][j];

  cout<<M(2).pow(n)-ans<<newl;
  return 0;
}
