#include <bits/stdc++.h>
using namespace std;
int r, g;
long long pre[200005], cur[200005];
const int mod = 1e9 + 7;
int main() {
  cin >> r >> g;
  int h = 0;
  for (; h * (h + 1) / 2 <= r + g; h++)
    ;
  h--;
  long long ans = 0;
  pre[0] = 1;
  int sum = 0;
  for (int i = 1; i <= h; i++) {
    sum += i;
    for (int j = max(0, sum - g); j <= min(r, sum); j++) {
      cur[j] = 0;
      if (sum - j >= i) cur[j] += pre[j];
      if (j >= i) cur[j] += pre[j - i];
      while (cur[j] > mod) cur[j] -= mod;
    }
    long long tmp = 0;
    for (int j = max(0, sum - g); j <= min(r, sum); j++) {
      pre[j] = cur[j];
      tmp += pre[j];
      while (tmp > mod) tmp -= mod;
    }
    if (!tmp) break;
    ans = tmp;
  }
  cout << ans << endl;
}
