#include <bits/stdc++.h>
using namespace std;
long long dp[2][200007];
int main() {
  long long r, g;
  cin >> r >> g;
  dp[0][0] = 1;
  int st = 0;
  for (long long h = 1; (h * (h + 1)) / 2 <= r + g; h++) {
    st ^= 1;
    for (int i = 0; i <= r; i++) dp[st][i] = 0;
    for (int i = 0; i <= r; i++) {
      int gg = (h * (h + 1)) / 2 - i;
      if (gg < 0 or gg > g) continue;
      dp[st][i] = (dp[st][i] + dp[!st][i]) % 1000000007;
      if (i - h >= 0) dp[st][i] = (dp[st][i] + dp[!st][i - h]) % 1000000007;
    }
  }
  long long ans = 0;
  for (int i = 0; i <= r; i++) ans = (ans + dp[st][i]) % 1000000007;
  cout << ans << endl;
}
