#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int dp[2][200010];
int main() {
  int r, g;
  scanf("%d %d", &r, &g);
  int h = sqrt(r + r + g + g);
  int ans = 0, need = 0;
  dp[0][0] = 1;
  for (int i = 1; i <= h; i++) {
    int id = i & 1, got = 0;
    need += i;
    for (int j = 0; j <= r; j++) {
      dp[id][j] = 0;
      if (j >= i) dp[id][j] += dp[id ^ 1][j - i];
      if (need - j <= g) dp[id][j] += dp[id ^ 1][j];
      while (dp[id][j] >= mod) dp[id][j] -= mod;
      got += dp[id][j];
      if (got >= mod) got -= mod;
    }
    if (got) ans = got;
  }
  printf("%d", ans);
}
