#include <bits/stdc++.h>
using namespace std;
long long int dp[405451] = {0};
long long int dpprev[405451] = {0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int r, g;
  cin >> r >> g;
  dpprev[0] = 1;
  long long int ans = 0;
  for (long long int i = 1; i <= 900; i++) {
    for (long long int j = 0; j <= i * (i + 1) / 2; j++) {
      dp[j] = 0;
    }
    for (long long int j = 0; j <= i * (i + 1) / 2; j++) {
      if (j <= r && (i * (i + 1) / 2) - j <= g) {
        dp[j] = dpprev[j];
        if (j >= i) {
          dp[j] = (dp[j] + dpprev[j - i]) % 1000000007;
        }
      }
    }
    long long int sum = 0;
    for (long long int j = 0; j <= i * (i + 1) / 2; j++) {
      dpprev[j] = dp[j];
      sum = (sum + dp[j]) % 1000000007;
    }
    if (sum != 0) {
      ans = sum;
    }
  }
  cout << ans << endl;
  return 0;
}
