#include <bits/stdc++.h>
using namespace std;
int n, a, b, second;
int d[500010];
int main() {
  cin >> a >> b;
  second = max(a + b, 0);
  for (int i = 1; i <= a + b; i++)
    if (i * (i + 1) / 2 <= a + b) {
      n = i;
      second = (i) * (i + 1) / 2;
    } else
      break;
  d[0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = second; j >= 0; j--)
      if (d[j] && j + i <= second) {
        d[j + i] += d[j];
        if (d[j + i] >= 1000000007) d[j + i] -= 1000000007;
      }
  int ans = 0;
  if (a < b) swap(a, b);
  for (int i = 0; i <= b; i++)
    if (second - i <= a) {
      ans = (ans + d[second - i]) % 1000000007;
    }
  cout << ans;
  return 0;
}
