#include <bits/stdc++.h>
using namespace std;
long long dp[300005];
long long fun(long long x) { return x * (1 + x) / 2; }
int main() {
  long long r, g, n;
  scanf("%lld %lld", &r, &g);
  n = (-1 + sqrt((double)(1 + 8 * (r + g)))) / 2;
  if (r != 0) dp[1] = 1;
  if (g != 0) dp[0] = 1;
  for (int i = 2; i <= n; i++) {
    long long m = min(r, fun(i));
    for (int j = m; j >= 1; j--) {
      if (fun(i - 1) - j + i <= g)
        dp[j] = dp[j] % 1000000007;
      else
        dp[j] = 0;
      if (j >= i) dp[j] = (dp[j] + dp[j - i]) % 1000000007;
    }
    if (fun(i) <= g)
      dp[0] = 1;
    else
      dp[0] = 0;
  }
  long long ans = 0;
  for (int i = 0; i <= r; i++) ans = (ans + dp[i]) % 1000000007;
  printf("%lld\n", ans);
  return 0;
}
