#include <bits/stdc++.h>
using namespace std;
int r, g, dp[2][200020];
int main() {
  scanf("%d %d", &r, &g);
  int h = 0, ans = 0, at = 1, sum[2];
  sum[0] = dp[0][0] = 1;
  for (int i = 1; i < 1020; i++) {
    int total = i * (i + 1) / 2;
    memset(dp[at], 0, sizeof dp[at]);
    if (total <= r) dp[at][0] = 1;
    bool T = false;
    sum[at] = dp[at][0];
    for (int green = 1; green <= min(g, total); green++) {
      int red = (total - green);
      if (red > r) continue;
      T = true;
      if (green < i)
        dp[at][green] = dp[at ^ 1][green];
      else
        dp[at][green] =
            (dp[at ^ 1][green - i] + dp[at ^ 1][green]) % 1000000007;
      sum[at] = (sum[at] + dp[at][green]) % 1000000007;
    }
    if (!T) {
      ans = sum[at ^ 1];
      break;
    }
    at ^= 1;
  }
  printf("%d\n", ans);
}
