#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  int r, g;
  cin >> r >> g;
  if (r < g) swap(r, g);
  vector<int> dp(r + 1, 0);
  int s = 0;
  int h = 0;
  while (s <= r + g) {
    h++;
    s += h;
  }
  s -= h;
  h--;
  dp[0] = 1;
  int m = 1;
  for (int i = 1; i <= h; i++) {
    for (int j = m - 1; j >= 0; j--) {
      if (j + i <= r) {
        dp[j + i] += dp[j];
        dp[j + i] %= MOD;
      }
    }
    m += i;
  }
  int ans = 0;
  for (int i = 0; i <= g; i++) {
    if (i + r >= s) {
      ans += dp[i];
      ans %= MOD;
    }
  }
  cout << ans << '\n';
  return 0;
}
