#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

const long long INF = 1e18;
const ll mod = 1000000007;
//vector<vector<ll>> dp0, dp1;
ll dp0[5005][5005];
ll dp1[5005][5005];
ll dp0sub0[5005][5005];
ll dp0sub1[5005][5005];

int main() {
    //dp1.resize(5005, vector<ll>(5005));
    //dp0 = dp1;
    ll N, A, B;
    cin >> N >> A >> B;
    if(A < B) swap(A, B);
    dp0[1][A-1] = 1;
    dp1[1][B-1] = 1;
    for(int i = 1; i <= N; i++) {
        for(int j = 0; j <= N; j++) {
            dp0[i][j] += dp0sub0[i][j];
            dp0[i][j] += dp0sub1[i][j];
            dp0[i][j] %= mod;
            if(j) {
                dp0sub0[i+1][j-1] += dp0sub0[i][j];
                dp0sub0[i+1][j-1] %= mod;
            }
            dp0sub1[i+1][j] += dp0sub1[i][j];
            dp0sub1[i+1][j] %= mod;
        }
        for(int j = 1; j <= N; j++) {
            dp0[i+1][j-1] += dp0[i][j];
            dp1[i+1][j-1] += dp1[i][j];
            dp0[i+1][j-1] %= mod;
            dp1[i+1][j-1] %= mod;
            /*
            for(int k = 1; k < B; k++) {
                dp0[i+k+1][A-1] += dp0[i][j];
                dp0[i+k+1][A-1] %= mod;
            }
            */
            if(j >= B) {
                /*
                for(int k = B; k < j; k++) {
                    dp0[i+k+1][j-k-1] += dp0[i][j];
                    dp0[i+k+1][j-k-1] %= mod;
                }
                */
                dp1[i+j][0] += dp0[i][j];
                if(i+B+1 <= N) {
                    dp0sub0[i+B+1][j-B-1] += dp0[i][j];
                    dp0sub0[i+B+1][j-B-1] %= mod;
                }
                dp1[i+j][0] %= mod;
                /*
                for(int k = 1; k < B; k++) {
                    dp0[i+k+1][A-1] += dp0[i][j];
                    dp0[i+k+1][A-1] %= mod;
                }
                */
               if(i+2 <= N) {
                    dp0sub1[i+2][A-1] += dp0[i][j];
                    dp0sub1[i+2][A-1] %= mod;
               }
               if(i + B + 1 <= N) {
                    dp0sub1[i+B+1][A-1] += mod - dp0[i][j];
                    dp0sub1[i+B+1][A-1] %= mod;
               }
            } else {
                dp1[i+1][B-1] += dp0[i][j];
                dp1[i+1][B-1] %= mod;
            }
            dp0[i+1][A-1] += dp1[i][j];
            dp0[i+1][A-1] %= mod;
        }
        dp1[i+1][0] += dp0[i][0];
        dp1[i+1][0] += dp1[i][0];
        dp1[i+1][0] %= mod;
        int idx = A - i - 1;
        chmax(idx, 0);
        dp0[i+1][idx] += dp0[i][0];
        dp0[i+1][idx] += dp1[i][0];
        dp0[i+1][idx] %= mod;
    }
    /*
    for(int i = 0; i <= N; i++) {
        for(int j = 0; j <= N; j++) {
            if(dp0[i][j] == 0 and dp1[i][j] == 0) continue;
            cerr<< i << " " << j << " " << dp0[i][j] << " " << dp1[i][j] << endl;
        }
        //cerr << i << " " << dp0[i][0] << " " << dp1[i][0] << endl;
    }
    */
    ll ans = dp0[N][0] + dp1[N][0];
    ans %= mod;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 785740