#include <bits/stdc++.h>
using namespace std;
int r, g;
int f[200005];
void solve() {
  cin >> r >> g;
  if (r > g) swap(r, g);
  int n = 0;
  for (int i = 1; i <= 1000; i++) {
    if (i * (i + 1) / 2 <= r + g)
      n = i;
    else
      break;
  }
  f[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int a = r; a >= i; a--) f[a] = (f[a] + f[a - i]) % 1000000007;
  }
  int ans = 0;
  for (int i = 0; i <= r; i++)
    if (n * (n + 1) / 2 - i <= g) ans = (ans + f[i]) % 1000000007;
  cout << ans;
}
int main() { solve(); }
