#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, MAXN = 4e5 + 10;
int dp[MAXN], dp2[MAXN];
int *cur = dp2, *prv = dp;
int main() {
  int r, g;
  cin >> r >> g;
  int b = r + g;
  int n;
  for (n = 1; n * (n + 1) / 2 <= b; n++)
    ;
  n--;
  cur[0] = 1;
  for (int i = 1; i <= n; i++) {
    swap(cur, prv);
    for (int j = 0; j <= i * (i + 1) / 2; j++) {
      cur[j] = (prv[j] + (j >= i ? prv[j - i] : 0)) % MOD;
    }
  }
  int ans = 0, sum = n * (n + 1) / 2;
  for (int i = 0; i <= r; i++) {
    if (i <= r && sum - i <= g) {
      ans = (ans + cur[i]) % MOD;
    }
  }
  cout << ans << endl;
}
