#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:268435456")
#pragma warning(disable : 4996)
using namespace std;
const int N = 2e5 + 100, mod = 1e9 + 7;
int r, g;
int dp[2][N];
bool ok = false;
inline void f(int &a, int b) {
  ok = true;
  a += b;
  if (a >= mod) a -= mod;
}
int main() {
  scanf("%d%d", &r, &g);
  dp[0][r] = 1;
  int c = 0;
  for (int i = 0;; i++) {
    c = i & 1;
    memset(dp[1 - c], 0, sizeof(dp[1 - c]));
    ;
    ok = false;
    for (int j = 0; j <= r; j++) {
      if (dp[c][j]) {
        int rg = g - (i * (i + 1) / 2 - (r - j));
        if (i + 1 <= rg) f(dp[1 - c][j], dp[c][j]);
        if (i + 1 <= j) f(dp[1 - c][j - i - 1], dp[c][j]);
      }
    }
    if (!ok) break;
  }
  int ans = 0;
  for (int i = 0; i <= r; i++) {
    f(ans, dp[c][i]);
  }
  printf("%d", ans);
  return 0;
}
