//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define trav(x,a) for (const auto& x: a)
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), x.end()
#define mem(a,v) memset((a), (v), sizeof (a))
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%lld", &(n))
#define nai(a, n) for (int _i = 0; _i < (n); _i++) ni(a[_i])
#define nal(a, n) for (int _i = 0; _i < (n); _i++) nl(a[_i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%lld\n", (n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vii vector<pii>
#define vll vector<pll>
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define mp make_pair
#define st first
#define nd second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef cc_hash_table<int,int,hash<int>> ht;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;
const double pi = acos(-1);
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
const int N = 5e3 + 5;
const double eps = 1e-9;

int dp[N][N][2][2];

inline int add(int& x, int y) { return x = x+y < mod ? x+y : x+y-mod; }
inline int sub(int& x, int y) { return x = x-y >= 0 ? x-y : x-y+mod; }
inline int mul(int x, int y) { return x * 1ll * y % mod; }
inline int pw(int x, int y) {
  int r = 1;
  for (; y; y /= 2, x = mul(x, x))
    if (y & 1)
      r = mul(r, x);
  return r;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, a, b; cin >> n >> a >> b;
  if (a > b)
    swap(a, b);
  if (a == 1) {
    printf("%d\n", pw(2, n));
    return 0;
  }
  dp[0][0][0][0] = 1;
  dp[0][0][0][1] = 1;

  dp[1][1][0][0] = mod-1;
  dp[1][1][0][1] = mod-1;
  for (int i = 0; i <= n; i++) {
    int sm[2] = {0, 0};
    for (int j = 0; j <= i; j++) {
      if (i > 0 && j > 0)
        for (int ii = 0; ii < 2; ii++)
          for (int jj = 0; jj < 2; jj++)
            add(dp[i][j][ii][jj], dp[i-1][j-1][ii][jj]);
      if (a + i <= n) {
        if (j+a >= b) {
          add(dp[i+a][j+a][1][0], dp[i][j][0][1]);
          sub(dp[i+n-i+1][j+n-i+1][1][0], dp[i][j][0][1]);
        } else {
          add(dp[i+a][j+a][0][0], dp[i][j][0][1]);
          sub(dp[min(N-1,i+b-j)][j+b-j][0][0], dp[i][j][0][1]);
          add(dp[min(N-1,i+b-j)][j+b-j][1][0], dp[i][j][0][1]);
          sub(dp[i+n-i+1][j+n-i+1][1][0], dp[i][j][0][1]);
        }
        add(dp[i+a][j+a][1][0], dp[i][j][1][1]);
        sub(dp[i+n-i+1][j+n-i+1][1][0], dp[i][j][1][1]);
      }
      if (j+1 >= b) {
        add(dp[i+1][j+1][1][1], dp[i][j][0][0]);
        sub(dp[i+n-i+1][j+n-i+1][1][1], dp[i][j][0][0]);
      } else {
        add(dp[i+1][j+1][0][1], dp[i][j][0][0]);
        sub(dp[min(N-1,i+b-j)][j+b-j][0][1], dp[i][j][0][0]);
        add(dp[min(N-1,i+b-j)][j+b-j][1][1], dp[i][j][0][0]);
        sub(dp[i+n-i+1][j+n-i+1][1][1], dp[i][j][0][0]);
      }
      add(dp[i+1][j+1][1][1], dp[i][j][1][0]);
      sub(dp[i+n-i+1][j+n-i+1][1][1], dp[i][j][1][0]);
      for (int k = 0; k < 2; k++)
        add(sm[k], dp[i][j][k][1]);
    }
    for (int nj = 1; nj + i <= n && nj < a; nj++) {
      for (int k = 0; k < 2; k++) {
        add(dp[i+nj][0][k][0], sm[k]);
        sub(dp[i+nj+1][1][k][0], sm[k]);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= n; i++)
    for (int j = 0; j < 2; j++)
      add(ans, dp[n][i][1][j]);
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 218784