#include <bits/stdc++.h>
using namespace std;
long long int dp[402000][2];
long long int r, g;
int main() {
  cin >> r >> g;
  long long h;
  for (h = 1; h * (h + 1) / 2 <= r + g; h++)
    ;
  h--;
  int a = 0;
  memset(dp, 0, sizeof(dp));
  dp[1][a] = 1;
  dp[0][a] = 1;
  for (int i = 2; i <= h; i++) {
    for (int j = 0; j <= r; j++) dp[j][a ^ 1] = 0;
    for (int j = 0; j <= r; j++)
      if (j >= i)
        dp[j][a ^ 1] = (dp[j][a] + dp[j - i][a]) % 1000000007;
      else
        dp[j][a ^ 1] = dp[j][a];
    a = a ^ 1;
  }
  long long ans = 0;
  long long cnt = h * (h + 1) / 2;
  for (int i = 0; i <= r; i++) {
    if (cnt - i <= g && cnt - i >= 0) {
      ans = (ans + dp[i][a]) % 1000000007;
    }
  }
  cout << (ans + 1000000007) % 1000000007;
  return 0;
}
