#include <bits/stdc++.h>
using namespace std;
long long f[2000001];
int main() {
  long long r, g;
  cin >> r >> g;
  if (r == 0 || g == 0) {
    cout << 1 << endl;
    return 0;
  }
  f[0] = 1;
  long long X = 1;
  while (((X) * (X + 1)) / 2 <= r + g) {
    X++;
  }
  X--;
  long long ret = 0;
  for (long long i = 1; i <= X; i++) {
    for (long long j = r; j >= 0; j--) {
      f[j] += ((j - i) >= 0 ? f[j - i] : 0);
      f[j] %= 1000000007;
    }
  }
  for (long long i = 0; i <= r; i++) {
    long long gg = (X * (X + 1) / 2) - i;
    if (gg > g) continue;
    ret += f[i];
    ret %= 1000000007;
  }
  cout << ret << endl;
}
