#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>

using namespace __gnu_pbds;
using namespace std;

using ll = long long;
using ld = long double;

#define mp make_pair

typedef tree<
        pair<int, int>,
        null_type,
        less<pair<int, int>>,
        rb_tree_tag,
        tree_order_statistics_node_update>
        ordered_set;


const int p = 1e9 + 7;


int mul(int a, int b) {
    return (1LL * a * b) % p;
}

int add(int a, int b) {
    int s = (a+b);
    if (s>=p) s-=p;
    return s;
}

int sub(int a, int b) {
    int s = (a+p-b);
    if (s>=p) s-=p;
    return s;
}

int po(int a, int deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, p-2);
}


mt19937 rnd(time(0));

struct DSU {
    vector<int> sz;
    vector<int> parent;

    void make_set(int v) {
        parent[v] = v;
        sz[v] = 1;
    }

    int find_set(int v) {
        if (v == parent[v])
            return v;
        return parent[v] = find_set(parent[v]);
    }

    void union_sets(int a, int b) {
        a = find_set(a);
        b = find_set(b);
        if (a != b) {
            if (sz[a] < sz[b])
                swap(a, b);
            parent[b] = a;
            sz[a] += sz[b];
        }
    }

    DSU(int n) {
        sz.resize(n);
        parent.resize(n);
        for (int i = 0; i < n; i++) make_set(i);
    }
};

/*
const int N = 1200000;

vector<int> facs(N), invfacs(N);

void init()
{
    facs[0] = 1;
    for (int i = 1; i<N; i++) facs[i] = mul(facs[i-1], i);
    invfacs[N-1] = inv(facs[N-1]);
    for (int i = N-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}

int C(int n, int k)
{
    if (n<k) return 0;
    return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}
*/

void solve()
{
    int n;
    cin>>n;
    int a, b;
    cin>>a>>b;
    if (a>b) swap(a, b);

    vector<vector<vector<int>>> block(2, vector<vector<int>>(2, vector<int>(b)));

    for (int len = 1; len<b; len++)
    {
        for (int last = 0; last<2; last++)
            for (int first = 0; first<2; first++)
            {
                if (first == last)
                {
                    if (last ==1|| len>=a) block[first][last][len] = 1;
                }
                if (last == 0)
                {
                    for (int lenlast = a; lenlast<len; lenlast++) block[first][last][len] = add(block[first][last][len], block[first][1-last][len - lenlast]);
                }
                else
                {
                    for (int lenlast = 1; lenlast<len; lenlast++) block[first][last][len] = add(block[first][last][len], block[first][1-last][len - lenlast]);
                }
            }
    }


    //cout<<"Here"<<endl;

    vector<int> dp1(n+1); //start with white
    vector<int> dp2(n+1); //start with block
    for (int i = 1; i<=n; i++)
    {
        if (i<a) dp1[i] = 1;
        for (int j = 1; j<min(a, i); j++) dp1[i] = add(dp1[i], dp2[i-j]);
        for (int j = 1; j<min(b, i); j++) dp2[i] = add(dp2[i], mul(block[1][1][j], dp1[i-j]));
    }

    ll res = 0;
    for (int pref = 0; pref<b; pref++)
        for (int suf = 0; suf<b; suf++) if (pref+suf<n)
        {
            int P, S;
            if (pref==0) P = 1;
            else P = add(block[0][1][pref], block[1][1][pref]);
            if (suf==0) S = 1;
            else S = add(block[1][0][suf], block[1][1][suf]);
            res = add(res, mul(mul(P, S), dp1[n-pref-suf] ));
        }

    cout<<sub(po(2, n), res);
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);

    int t = 1;
    //cin>>t;
    while(t--) solve();


}


Measured memory_bytes: 3800