Problem: There are r red and g green blocks for construction of the red-green tower. Red-green tower can be built following next rules:

  * Red-green tower is consisting of some number of levels;

  * Let the red-green tower consist of n levels, then the first level of this tower should consist of n blocks, second level — of n - 1 blocks, the third one — of n - 2 blocks, and so on — the last level of such tower should consist of the one block. In other words, each successive level should contain one block less than the previous one;

  * Each level of the red-green tower should contain blocks of the same color.

<image>

Let h be the maximum possible number of levels of red-green tower, that can be built out of r red and g green blocks meeting the rules above. The task is to determine how many different red-green towers having h levels can be built out of the available blocks.

Two red-green towers are considered different if there exists some level, that consists of red blocks in the one tower and consists of green blocks in the other tower.

You are to write a program that will find the number of different red-green towers of height h modulo 109 + 7.

Input

The only line of input contains two integers r and g, separated by a single space — the number of available red and green blocks respectively (0 ≤ r, g ≤ 2·105, r + g ≥ 1).

Output

Output the only integer — the number of different possible red-green towers of height h modulo 109 + 7.

Examples

Input

4 6


Output

2


Input

9 7


Output

6


Input

1 1


Output

2

Note

The image in the problem statement shows all possible red-green towers for the first sample.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
int MOD1 = 1000000007;
int MOD2 = 1000000009;
inline bool checkBit(long long int n, long long int i) {
  return n & (1LL << i);
}
inline long long int setBit(long long int n, long long int i) {
  return n | (1LL << i);
  ;
}
inline long long int resetBit(long long int n, long long int i) {
  return n & (~(1LL << i));
}
int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline bool isLeapYear(long long int year) {
  return (year % 400 == 0) || (year % 4 == 0 && year % 100 != 0);
}
inline void normal(long long int &a) {
  a %= 1000000007;
  (a < 0) && (a += 1000000007);
}
inline long long int modMul(long long int a, long long int b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  return (a * b) % 1000000007;
}
inline long long int modAdd(long long int a, long long int b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  return (a + b) % 1000000007;
}
inline long long int modSub(long long int a, long long int b) {
  a %= 1000000007, b %= 1000000007;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline long long int modPow(long long int b, long long int p) {
  long long int r = 1LL;
  while (p) {
    if (p & 1) r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1LL;
  }
  return r;
}
inline long long int modDiv(long long int a, long long int b) {
  return modMul(a, modPow(b, 1000000007 - 2));
}
bool comp(const pair<int, int> &p1, const pair<int, int> &p2) {
  return p1.second < p2.second;
}
long long int converter(string a) {
  long long int i, mul = 1, r, t, ans = 0LL;
  if (a.length() == 0) return 0;
  for (i = a.length() - 1; i >= 0; i--) {
    t = a[i] - '0';
    r = t % 10;
    ans += (mul * r);
    mul = mul * 10;
  }
  return ans;
}
long long int dp[2][200005];
long long int sum(long long int x) { return (x * (x + 1)) / 2; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int g, r, h = 0, i, j, x, cur, a, b, in;
  cin >> a >> b;
  x = 1;
  cur = 1;
  while (cur <= (a + b)) {
    if (sum(x + 1) <= (a + b))
      x++;
    else
      break;
    cur = sum(x);
  }
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  in = 0;
  for (long long int h = 1; h <= x; ++h) {
    in = 1 - in;
    for (g = 0; g <= b; ++g) {
      r = sum(h) - g;
      if (r < 0) break;
      if (g >= h) dp[in][g] = dp[1 - in][g - h];
      if (a >= r) dp[in][g] = (dp[in][g] + dp[1 - in][g]) % 1000000007;
    }
    for (g = 0; g <= b; ++g) {
      dp[1 - in][g] = 0;
    }
  }
  long long int ans = 0;
  for (i = 0; i <= b; ++i) {
    ans += dp[in][i];
    if (ans > 1000000007) {
      ans -= 1000000007;
    }
  }
  cout << ans << '\n';
  return 0;
}