#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
const int mod = 1e9 + 7;
int dp[2][N];
int f[N];
int modo(int val) {
  if (val > mod) return val - mod;
  return val;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int r, g;
  cin >> r >> g;
  int ref = 0;
  for (int i = int(0); i < int(N); ++i) f[i] = (i * (i + 1)) >> 1;
  while (f[ref] <= r + g) ref++;
  ref--;
  dp[1][1] = 1;
  dp[1][0] = 1;
  for (int h = int(2); h < int(ref + 1); ++h) {
    int lim = min(f[h] + 1, N);
    for (int i = int(0); i < int(lim); ++i) {
      dp[h & 1][i] = 0;
      if (i >= h) dp[h & 1][i] = modo(dp[h & 1][i] + dp[1 - (h & 1)][i - h]);
      if (f[h] - i >= h)
        dp[h & 1][i] = modo(dp[h & 1][i] + dp[1 - (h & 1)][f[h] - i - h]);
    }
  }
  int ans = 0;
  for (int i = int(0); i < int(f[ref] + 1); ++i)
    if ((i <= r) && (f[ref] - i <= g)) ans = modo(ans + dp[ref & 1][i]);
  cout << ans << endl;
  return 0;
}
