#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

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;
}

vector<ll> inv, fact, invfact;
void Mod_build(int n = 101010) {
    fact.resize(n + 1);
    inv.resize(n + 1);
    invfact.resize(n + 1);
    fact[0] = inv[0] = invfact[0] = 1;
    inv[1] = 1;
    for (ll i = 0; i < n; i++) {
        fact[i + 1] = fact[i] * (i + 1) % mod;
        if (i > 0) inv[i + 1] = mod - inv[mod % (i + 1)] * (mod / (i + 1)) % mod;
        invfact[i + 1] = invfact[i] * inv[i + 1] % mod;
    }
}
ll perm(int n, int k) {
    if (n < 0 || k < 0 || k > n) return 0;
    return fact[n] * invfact[n - k] % mod;
}
ll comb(int n, int k) {
    if (n < 0 || k < 0 || k > n) return 0;
    return (fact[n] * invfact[n - k] % mod) * invfact[k] % mod;
}
ll powmod(ll n, ll k) {
    k %= mod - 1;
    if (k < 0) k += mod - 1;
    ll ret = 1;
    while (k) {
        if (k & 1) ret = ret * n % mod;
        n = n * n % mod;
        k >>= 1;
    }
    return ret;
}

ll modinv(ll a) {
    ll m = mod;
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main() {
    Mod_build();
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int i, j;
    ll n, a, b;
    cin >> n >> a >> b;
    if (a < b) swap(a, b);
    if (b == 1) {
        cout << powmod(2, n) << endl;
        return 0;
    }
    VI bb(n + 3, 0);
    VI aa(n + 3, 0);
    for (i = 1; i <= b + 1; i++) bb[i] = i;
    for (i = b + 2; i <= n + 2; i++) {
        bb[i] = 1 + bb[i - 1];
        bb[i] %= mod;
        for (j = 1; j <= i - 1 - b; j++) {
            bb[i] += bb[j];
            bb[i] %= mod;
        }
    }
    for (i = n + 2; i >= 1; i--) {
        aa[i] = mod + bb[i] - bb[i - 1];
        aa[i] %= mod;
    }

    VVI dp1(n + 1, VI(a, 0));
    VVI dp2(n + 1, VI(b, 0));
    VVI dp3(n + 1, VI(a, 0));
    ll ans = 0;
    for (i = 0; i < n; i++) {
        if (i == 0) {
            // dp1[i][1] = 1;
            dp2[i][1] = 1;
            dp3[i][1] = 1;
        } else {
            for (j = 1; j < a; j++) {
                dp2[i][1] += dp1[i - 1][j] * aa[j];
                dp2[i][1] %= mod;
                dp2[i][1] += dp3[i - 1][j] * aa[j + 1];
                dp2[i][1] %= mod;
            }
            for (j = 1; j < b; j++) {
                dp1[i][1] += dp2[i - 1][j];
                dp1[i][1] %= mod;
            }
            for (j = a - 1; j >= 2; j--) {
                dp1[i][j] = dp1[i - 1][j - 1];
                dp3[i][j] = dp3[i - 1][j - 1];
            }
            for (j = b - 1; j >= 2; j--) dp2[i][j] = dp2[i - 1][j - 1];
        }
    }
    for (j = 1; j < a; j++) {
        ans += dp1[n - 1][j] * aa[j + 1];
        ans %= mod;
        ans += dp3[n - 1][j] * aa[j + 2];
        ans %= mod;
    }
    for (j = 1; j < b; j++) {
        ans += dp2[n - 1][j];
        ans %= mod;
    }
    for (i = 0; i < n; i++) {
        //cout << i << endl;
        for (j = 0; j < a; j++) {
            //cout << j << " " << dp1[i][j] << endl;
        }
        for (j = 0; j < a; j++) {
            //cout << j << " " << dp3[i][j] << endl;
        }
        for (j = 0; j < b; j++) {
            //cout << j << " " << dp2[i][j] << endl;
        }
    }
    cout << (powmod(2, n) + mod - ans) % mod << endl;
}

Measured memory_bytes: 592356