#include <bits/stdc++.h>
using namespace std;
int mod = 1000000000 + 7;
int dp[2][2 * 100000 + 5];
int main() {
  int r, g, h, i, j;
  scanf("%d %d", &r, &g);
  for (h = 1;; h++) {
    if ((h * (h + 1)) / 2 > (r + g)) break;
  }
  h--;
  if (r > g) swap(r, g);
  int x = 0, y = 1;
  dp[0][0] = 1;
  for (i = 1; i <= h; i++) {
    for (j = 0; j <= r; j++) {
      if (j >= i)
        dp[y][j] = (dp[x][j] + dp[x][j - i]) % mod;
      else
        dp[y][j] = dp[x][j];
    }
    x ^= 1;
    y ^= 1;
  }
  int ans = 0;
  int total = (h * (h + 1)) / 2;
  for (i = 0; i <= r; i++) {
    if (total - i <= g) ans = (ans + dp[x][i]) % mod;
  }
  printf("%d\n", ans);
  return 0;
}
