#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
const int mod = 1e9 + 7;
int dp[2][maxn];
int get_num(int i) { return i * (i + 1) / 2; }
int main() {
  int r, g;
  while (~scanf("%d%d", &r, &g)) {
    int ans = 0;
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    int i;
    for (i = 1;; i++) {
      int f = i % 2, flag = 1;
      int num = get_num(i);
      int stop = min(num, g);
      for (int j = 0; j <= num; j++) dp[f][j] = 0;
      for (int j = 0; j <= stop; j++) {
        if (r < num - j) continue;
        flag = 0;
        if (j >= i)
          dp[f][j] = (dp[f ^ 1][j] + dp[f ^ 1][j - i]) % mod;
        else
          dp[f][j] = dp[f ^ 1][j] % mod;
      }
      int tmpp = 0;
      for (int j = 0; j <= stop; j++) {
        if (dp[f][j]) {
          flag = 0;
          tmpp = (tmpp + dp[f][j]) % mod;
        }
      }
      if (flag) break;
      ans = tmpp;
    }
    printf("%d\n", ans);
  }
}
