#include <bits/stdc++.h>
using namespace std;
const int SQMAX = 570;
const int MAXN = 200050;
const int MOD = (int)1e9 + 7;
int r, g, dp[2][2 * MAXN];
void add(int &a, int b) { a = (a + b) % MOD; }
int main() {
  while (scanf("%d%d", &r, &g) >= 1) {
    int H;
    for (H = 1; (H + 1) * (H + 2) <= 2 * (r + g); H++)
      ;
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    dp[0][1] = 1;
    for (int h = (2); h < (int)(H + 1); h++) {
      int knowh = h % 2;
      int currh = (h + 1) % 2;
      for (int red = (0); red < (int)(h * (h + 1) / 2 + 1); red++) {
        add(dp[currh][red], dp[knowh][red]);
        if (red >= h) {
          add(dp[currh][red], dp[knowh][red - h]);
        }
      }
      memset(dp[knowh], 0, sizeof(dp[knowh]));
    }
    int ans = 0;
    for (int red = (0); red < (int)(r + 1); red++) {
      int green = H * (H + 1) / 2 - red;
      if (green <= g) {
        add(ans, dp[(H + 1) % 2][red]);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
