#include<bits/stdc++.h> #define int long long usingnamespace std; int dp[200005]; signedmain() { int r, g, mod = 1e9 + 7; scanf("%lld%lld", &r, &g); if (r < g) swap(r, g); int h = (-1 + sqrt(1 + 8 * (r + g))) / 2; int sum = h * (h + 1) / 2;
dp[0] = 1; for (int i = 1; i <= h; i++) { for (int j = r; j; j--) { if (j >= i) dp[j] = (dp[j - i] + dp[j]) % mod; } } int res = 0, n = min(r, sum); for (int i = max(0ll, sum - g); i <= n; i++) res = (res + dp[i]) % mod; printf("%lld\n", res); return0; }