#include <bits/stdc++.h>
using namespace std;
int a[2][500005] = {0};
int main() {
  int r, g, n, i, j, y, p, s, mi;
  int ans, Ans;
  scanf("%d%d", &r, &g);
  if (r) a[0][1] = 1;
  if (g) a[0][0] = 1;
  p = 0;
  n = sqrt(r + g) + 2;
  Ans = a[0][1] + a[0][0];
  for (s = 1, i = 2;; s += i, i++, p ^= 1) {
    for (j = 0; j <= r; j++) a[p ^ 1][j] = 0;
    mi = min(s, r);
    for (j = 0; j <= mi; j++) {
      if (j + i <= r)
        a[p ^ 1][j + i] = (a[p ^ 1][j + i] + a[p][j]) % 1000000007;
      if (s - j + i <= g) a[p ^ 1][j] = (a[p ^ 1][j] + a[p][j]) % 1000000007;
    }
    ans = 0;
    for (j = 0; j <= r; j++) {
      ans = (ans + a[p ^ 1][j]) % 1000000007;
    }
    if (ans)
      Ans = ans;
    else
      break;
  }
  printf("%d\n", Ans);
  return 0;
}
