#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7;
long long g, r, h, dp[2][200100];
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  cin >> r >> g;
  for (long long i = 1; i <= 1e3; i++) {
    if ((i * (i + 1)) / 2 > (g + r)) {
      h = i - 1;
      break;
    }
  }
  for (int i = 0; i <= r; i++) dp[(h + 1) % 2][i] = 1;
  for (long long i = h; i >= 1; i--) {
    for (long long j = 0; j <= r; j++) {
      int Res1 = 0, Res2 = 0, Have = (((i - 1) * i) / 2) - (r - j);
      if (j >= i) Res1 = dp[(i + 1) % 2][j - i];
      if (g - Have >= i) Res2 = dp[(i + 1) % 2][j];
      dp[i % 2][j] = (Res1 + Res2) % Mod;
    }
  }
  cout << dp[1][r];
  return 0;
}
