#include <bits/stdc++.h>
using namespace std;
long long dp[2][200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long mod = 1e9 + 7;
  long long r, g;
  cin >> r >> g;
  long long H = 0;
  while (H * (H + 1) <= 2 * (r + g)) H++;
  H--;
  dp[0][0] = 1;
  for (int h = 1; h <= H; h++) {
    long long state = h & 1;
    for (int red = 0; red <= r; red++) {
      dp[state][red] = 0;
      if (red - h >= 0) {
        dp[state][red] = dp[1 - state][red - h];
        if (dp[state][red] >= mod) {
          dp[state][red] -= mod;
        }
      }
      if (g - ((h * (h - 1)) / 2 - red) >= h) {
        dp[state][red] += dp[1 - state][red];
        if (dp[state][red] >= mod) {
          dp[state][red] -= mod;
        }
      }
    }
  }
  long long ans = 0;
  for (int red = 0; red <= r; red++) {
    ans = ans + dp[H & 1][red];
    if (ans >= mod) {
      ans -= mod;
    }
  }
  cout << ans << endl;
  return 0;
}
