#include <bits/stdc++.h>
using namespace std;
int const N = 2e5 + 5;
long long int const mod = 1e9 + 7;
int dp1[2][N];
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int r, g, i, j, l;
  cin >> r >> g;
  int h;
  h = sqrt(r + g);
  if (r < g) swap(r, g);
  for (;;) {
    if ((h + 2) * (h + 1) / 2 <= (r + g)) {
      h++;
    } else {
      break;
    }
  }
  int t = h * (h + 1) / 2;
  long long int ans = 0;
  dp1[0][0] = 1;
  for (i = h; i > 0; i--) {
    for (j = 0; j <= r; j++) {
      dp1[1][j] = dp1[0][j] + (j >= i ? dp1[0][j - i] : 0);
      dp1[1][j] %= mod;
    }
    for (j = 0; j <= r; j++) {
      dp1[0][j] = dp1[1][j];
    }
  }
  for (; r + g >= t; r--) {
    ans = ans + dp1[0][r];
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
