#include <bits/stdc++.h>
using namespace std;
long long dp[200005];
int f[200005];
long long MOD = 1000000000 + 7;
int main() {
  long long a, b;
  cin >> a >> b;
  if (a > b) {
    swap(a, b);
  }
  long long s = a + b;
  long long sum = 0;
  int n;
  for (int i = 1; i < 100000; i++) {
    sum += i;
    if (sum > s) {
      n = i - 1;
      sum -= i;
      break;
    }
  }
  memset(dp, 0, sizeof(dp));
  memset(f, 0, sizeof(f));
  f[0] = 1;
  dp[0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = a; j >= i; j--)
      if (f[j - i]) {
        f[j] = 1;
        dp[j] = (dp[j] + dp[j - i]) % MOD;
      }
  long long ans = 0;
  for (long long i = max(sum - b, 0LL); i <= a; i++) ans = (ans + dp[i]) % MOD;
  cout << ans << endl;
}
