#include <bits/stdc++.h>
using namespace std;
template <class T>
void show(const vector<T> &a) {
  for (T x : a) cout << x << " ";
  cout << '\n';
}
const long long N = 3e5 + 50, oo = 1e18 + 100, mod = 1e9 + 7;
const long double eps = 1e-9, PI = 2 * acos(0.0);
vector<long long> vertices[N];
vector<long long> visit(N, 0);
long long n, m, k;
long long cnt = 0;
long long dp[N][2];
void add(long long &x, long long y) { x = (x + y) % mod; }
signed main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> n >> m;
  long long x = (-1 + sqrt(1 + 8 * (n + m))) / 2;
  cnt = 0;
  dp[n][0] = 1;
  long long f = 0, s = 1;
  for (long long i = x; i >= 1; i--) {
    for (long long j = 0; j <= n; j++) {
      long long r = j;
      long long g = n + m - cnt - j;
      if (g < 0) break;
      if (r >= i) {
        add(dp[r - i][s], dp[r][f]);
      }
      if (g >= i) {
        add(dp[r][s], dp[r][f]);
      }
    }
    swap(f, s);
    for (long long j = 0; j <= n; j++) {
      dp[j][s] = 0;
    }
    cnt += i;
  }
  cnt = 0;
  for (long long i = 0; i <= n; i++) add(cnt, dp[i][f]);
  cout << cnt;
  return 0;
}
