#include <bits/stdc++.h>
using namespace std;
inline int max(int x, int y) { return x > y ? x : y; }
inline int min(int x, int y) { return x > y ? y : x; }
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  return x * f;
}
const int N = 2e5 + 10;
const int mod = 1e9 + 7;
int n, m, dp[N];
int main() {
  n = read(), m = read();
  int h = sqrt(2 * n + 2 * m);
  while (h * (h + 1) <= 2 * n + 2 * m) h++;
  dp[0] = 1;
  for (int i = 1; i < h; i++)
    for (int j = n; j >= i; j--) (dp[j] += dp[j - i]) %= mod;
  int ans = 0;
  for (int i = n; i >= 0; i--) {
    if (h * (h - 1) / 2 - i > m) break;
    (ans += dp[i]) %= mod;
  }
  cout << ans;
}
