#include <bits/stdc++.h>
using namespace std;
long long int dp[2][200005];
int main() {
  long long int r, g;
  cin >> r >> g;
  long long int n, sum = r + g;
  for (long long int i = 0; i < 1000; i++) {
    if ((i * (i + 1) / 2) > sum) {
      n = i - 1;
      break;
    }
  }
  long long int g0 = r + g - n * (n + 1) / 2;
  for (long long int i = 0; i < 200005; i++) dp[0][i] = 0;
  for (long long int i = 0; i < g0 + 1; i++) dp[0][i] = 1;
  for (long long int i = 1; i < n + 1; i++) {
    for (long long int j = 0; j < r + 1; j++) {
      dp[1][j] = 0;
      dp[1][j] += dp[0][j];
      if (j >= i) dp[1][j] += dp[0][j - i];
      dp[1][j] = dp[1][j] % 1000000007;
    }
    for (long long int j = 0; j < r + 1; j++) {
      dp[0][j] = dp[1][j];
    }
  }
  cout << dp[1][r] << '\n';
}
