#include <bits/stdc++.h>
using namespace std;
const int Maxn = 200 * 1000 + 10, inf = 1000 * 1000 * 1000 + 7;
int r, g, ans, d[2][Maxn];
void filldnm() {
  long long int sum = 0;
  if (r >= 1) d[0][0] = 1;
  if (g >= 1) d[0][1] = 1;
  sum += d[0][0] + d[0][1];
  ans = sum;
  int i = 1;
  while (sum > 0) {
    sum = 0;
    for (int j = 0; j <= min(g, (i + 1) * (i + 2) / 2); j++) {
      if ((i + 1) * (i + 2) / 2 - j <= r) {
        if (j > i) {
          d[i % 2][j] = (d[(i - 1) % 2][j] + d[(i - 1) % 2][j - i - 1]) % inf;
        } else {
          d[i % 2][j] = d[(i - 1) % 2][j];
        }
        sum += d[i % 2][j];
      }
      sum %= inf;
    }
    if (sum != 0) ans = sum;
    i++;
  }
}
int main() {
  cin >> r >> g;
  filldnm();
  cout << ans << endl;
  return 0;
}
