#include <bits/stdc++.h>
using namespace std;
void show() { cout << '\n'; }
template <typename T, typename... Args>
void show(T a, Args... args) {
  cout << a << " ";
  show(args...);
}
template <typename T>
void show_c(T& a) {
  for (auto& x : a) {
    cout << x << " ";
  }
  cout << endl;
}
int dp[2][200002];
int mod = 1e9 + 7;
int main() {
  int r, g;
  scanf("%d %d", &r, &g);
  if (r > g) swap(r, g);
  for (int i = 0; i <= r; ++i) {
    dp[0][i] = dp[1][i] = 1;
  }
  int height = 1;
  while (true) {
    if ((height + 1) * (height + 2) / 2 > (r + g)) {
      break;
    }
    ++height;
  }
  for (int i = height; i > 0; --i) {
    for (int j = 0; j <= r; ++j) {
      dp[i & 1][j] = 0;
      if (j >= i) {
        dp[i & 1][j] += dp[(i & 1) ^ 1][j - i];
        dp[i & 1][j] %= mod;
      }
      int gleft = g - (i * (i - 1) / 2 - (r - j));
      if (gleft >= i) {
        dp[i & 1][j] += dp[(i & 1) ^ 1][j];
        dp[i & 1][j] %= mod;
      }
    }
  }
  printf("%d\n", dp[1][r]);
  return 0;
}
