#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int a[210000], b[210000];
int n, m, tot;
inline void add_counter(int &counter, int val) {
  counter += val;
  if (counter > MOD) counter -= MOD;
}
int dp(int h) {
  int i, j, k, ret;
  int layer, size = 0;
  int *pre = a, *cur = b, *temp;
  memset(pre, 0, (n + 1) * sizeof(int));
  a[0] = 1;
  for (i = 0; i < h; ++i) {
    layer = h - i;
    memset(cur, 0, (n + 1) * sizeof(int));
    for (j = 0; j <= n; ++j) {
      k = size - j;
      if (k < 0) break;
      if (j + layer <= n) add_counter(cur[j + layer], pre[j]);
      if (k + layer <= m) add_counter(cur[j], pre[j]);
    }
    size += layer;
    temp = cur;
    cur = pre;
    pre = temp;
  }
  for (i = ret = 0; i <= n; ++i) add_counter(ret, pre[i]);
  return ret;
}
void conduct() {
  int i;
  tot = n + m;
  for (i = 1; i < tot; ++i)
    if (i * (i + 1) / 2 > tot) break;
  --i;
  printf("%d\n", dp(i));
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) conduct();
  return 0;
}
