#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
long long dp[200010][2];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long r, g;
  cin >> r >> g;
  long long maxH = 0;
  for (long long i = 0; i < (1000); ++i)
    if (i * (i + 1) / 2 > r + g) {
      maxH = i - 1;
      break;
    }
  dp[0][0] = 1;
  for (long long h = (1); h < (maxH + 1); ++h) {
    long long curBlocks = h * (h + 1) / 2;
    for (long long i = (h); i < (min(curBlocks, r) + 1); ++i)
      dp[i][h & 1] = (dp[i - h][~h & 1] + dp[i][h & 1]) % 1000000007LL;
    for (long long i = (max(0LL, curBlocks - g));
         i < (min(r, curBlocks - h) + 1); ++i)
      dp[i][h & 1] = (dp[i][~h & 1] + dp[i][h & 1]) % 1000000007LL;
    for (long long i = 0; i < (r + 1); ++i) dp[i][~h & 1] = 0;
  }
  long long sum = 0;
  for (long long i = 0; i < (r + 1); ++i)
    sum = (sum + dp[i][maxH & 1]) % 1000000007LL;
  cout << sum << '\n';
  return 0;
}
