#include <bits/stdc++.h>
using namespace std;
long long dist[2][400005];
int main() {
  long long r, g;
  cin >> r >> g;
  if (r > g) {
    swap(r, g);
  }
  int h = 0;
  for (int i = 0; i < 1001; i++) {
    int tmp = i * (i + 1);
    tmp >>= 1;
    if (tmp > r + g) {
      break;
    }
    h = i;
  }
  dist[0][0] = 1;
  for (int i = 1; i <= h; i++) {
    dist[i % 2][0] = 1;
    int limit = (i * (i + 1)) >> 1;
    for (int j = 1; j <= limit; j++) {
      int past = (i + 1) % 2;
      int curr = i % 2;
      if (j < i) {
        dist[curr][j] = dist[past][j];
      } else {
        dist[curr][j] = dist[past][j] + dist[past][j - i];
      }
      dist[curr][j] %= 1000000007;
    }
  }
  int tot = (h * (h + 1)) >> 1;
  long long ans = 0;
  int idx = h % 2;
  for (int i = 0; i <= r; i++) {
    if (tot - i <= g) {
      ans += (dist[idx][i]);
      ans = ans % 1000000007;
    }
  }
  cout << ans;
  return 0;
}
