#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long a, b, h, ans, f[1000010];
int main() {
  scanf("%lld%lld", &a, &b);
  h = sqrt((a + b) * 2);
  while (h * (h + 1) <= (a + b) * 2) h++;
  f[0] = 1;
  for (int i = 1; i < h; i++) {
    long long sum = i * (i + 1) / 2;
    for (int j = b; j >= i; j--)
      if (sum - j <= a) f[j] = (f[j] + f[j - i]) % mod;
  }
  for (int i = 0; i <= b; i++)
    if (h * (h - 1) / 2 - i <= a) ans = (ans + f[i]) % mod;
  printf("%lld\n", ans);
}
