#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long r, g;
  cin >> r >> g;
  long long dp[r + 1][2];
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  long long temp = r + g;
  double k = -1 + sqrt(1.0 + 8.0 * (double)(temp));
  k = k / 2.0;
  long long num = (long long)(k);
  long long p = (num * (num + 1)) / 2;
  for (long long i = 1; i <= num; i++) {
    for (long long j = 0; j <= r; j++) {
      dp[j][i % 2] = dp[j][1 - (i % 2)];
      if (j >= i) dp[j][i % 2] += dp[j - i][1 - (i % 2)];
      dp[j][i % 2] = dp[j][i % 2] % 1000000007;
    }
  }
  long long res = 0;
  for (long long i = max((long long)(0), p - g); i <= r; i++) {
    res += dp[i][num % 2];
    res = res % 1000000007;
  }
  cout << res << "\n";
}
