#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int h, p[200005], r, g;
int cal(int k, int i) {
  long long ans = 0;
  if (i - (3 * k - 1) * k / 2 >= 0) ans += p[i - (3 * k - 1) * k / 2];
  if (i - (3 * k + 1) * k / 2 >= 0) ans += p[i - (3 * k + 1) * k / 2];
  ans %= MOD;
  if (k & 1) return ans;
  return -ans;
}
int dp[400005];
void solve() {
  dp[0] = 1;
  for (int i = 1; i <= min(r, h); i++) {
    for (int j = i * (i + 1) / 2; j >= i; j--) {
      dp[j] += dp[j - i];
      if (dp[j] >= MOD) dp[j] -= MOD;
    }
  }
}
int main() {
  cin >> r >> g;
  while (1) {
    if (h * (h + 1) / 2 > r + g) break;
    h++;
  }
  h--;
  if (r > g) swap(r, g);
  solve();
  int ans = 0;
  for (int i = max(h * (h + 1) / 2 - g, 0); i <= min(r, h * (h + 1) / 2); i++) {
    ans += dp[i];
    if (ans >= MOD) ans -= MOD;
  }
  cout << ans << endl;
  return 0;
}
