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;
using int64 = long long;

constexpr int DEBUG = 0;

constexpr int64 P = 1000000007;

struct FiniteField {
 private:
  int64 x;
 public:
  FiniteField(int64 x) : x(x) {
    if (x > P || x < 0) { cerr << "Invalied FiniteField!" << endl; exit(1); }
  }
  FiniteField() : x(0) {}
  int64 Value() const { return x; }
  inline FiniteField operator+(FiniteField o) const {
    FiniteField r(*this); r += o; return r;
  }
  inline FiniteField operator-(FiniteField o) const {
    FiniteField r(*this); r -= o; return r;
  }
  inline FiniteField operator* (FiniteField o) const {
    FiniteField r(*this); r *= o; return r;
  }
  inline FiniteField operator/ (FiniteField o) const {
    FiniteField r(*this); r /= o; return r;
  }
  inline void operator+= (FiniteField o) { x = (x + o.x) % P; }
  inline void operator-= (FiniteField o) { x = (x + P - o.x) % P; }
  inline void operator*= (FiniteField o) { x = (x * o.x) % P; }
  void operator/=(FiniteField o) {
    int64 p = P - 2; while (p) { if (p % 2) { *this *= o; } o *= o; p /= 2; }
  }
};

template<typename T>
vector<vector<T>> Make2DVector(int d1, int d2, T default_value) {
  return vector<vector<T>>(d1, vector<T>(d2, default_value));
}

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

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

  auto dp1 = Make2DVector<FiniteField>(n + 1, b, 0);
  dp1[0][0] = 1;
  auto dp2 = vector<FiniteField>(n + 1, 0);
  dp2[0] = 1;
  auto dp3 = Make2DVector<FiniteField>(n + 1, b, 0);
  dp3[0][0] = 1;

  for (int i = 1; i <= n; i++) {
    if (i >= 2) {
      dp1[i][1] += dp2[i - 2];
      if (i - a - 1 >= 0) dp1[i][1] -= dp2[i - a - 1];
    }

    for (int j = 1; j < b; j++) {
      dp1[i][j] += dp1[i - 1][j - 1];

      if (i - a - 1 >= 0 && j - a - 1 >= 0) {
        dp1[i][j] += dp3[i - a - 1][j - a - 1];
      }
    }

    dp2[i] = dp2[i - 1];
    for (int j = 1; j < b; j++) {
      dp2[i] += dp1[i][j];
    }

    for (int j = 1; j < b; j++) {
      dp3[i][j] = dp3[i - 1][j - 1] + dp1[i][j];
    }
  }

  FiniteField r = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < b; j++) {
      int l = j;
      if (n - i >= a) {
        l += n - i;
      }
      if (l < b) {
        r += dp1[i][j];
      }
    }
  }

  FiniteField ans = 1;
  for (int i = 0; i < n; i++) ans *= 2;
  ans -= r;
  cout << ans.Value() << endl;
}