#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define faster() ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
const int MOD = 1e9 + 7 ;
void solve() {
int r , g ; cin >> r >> g ;
int total = r + g ; // tong so khoi ban dau
int h = 0 ;
while(h * (h + 1) / 2 <= total) ++h ;
--h ;// tim chieu cao toi da cua thap
vector<int> dp(r + 5 , 0); // dp[i] : dung i mau do de xay dung cap do
dp[0] = 1 ; // chua su dung cac mau do thi chi co 1 cach la khong lam gi
for(int i = 1 ; i <= h ; i++){
for(int j = r ; j >= i ; j--){
dp[j] += dp[j - i];
dp[j] %= MOD ;
}
}
int ans = 0 ;
int maxBlocks = (h + 1) * h / 2 ;
for(int i = 0 ; i <= r ; i++){
int greenBlock = maxBlocks - i ;
if(greenBlock >= 0 && greenBlock <= g){
ans += dp[i];
ans %= MOD ;
}
}
cout << ans << endl;
}
signed main() {
faster();
int test = 1 ;
// cin >> test ;
while(test--) solve();
return 0;
}
CiNpbmNsdWRlPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgZW5kbCAiXG4iCiNkZWZpbmUgaW50IGxvbmcgbG9uZwojZGVmaW5lIGZhc3RlcigpIGlvczo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsgY2luLnRpZShudWxscHRyKTsgY291dC50aWUobnVsbHB0cik7CmNvbnN0IGludCBNT0QgPSAxZTkgKyA3IDsKdm9pZCBzb2x2ZSgpIHsKICAgIGludCByICwgZyA7IGNpbiA+PiByID4+IGcgOwogICAgaW50IHRvdGFsID0gciArIGcgOyAvLyB0b25nIHNvIGtob2kgYmFuIGRhdQogICAgaW50IGggPSAwIDsKICAgIHdoaWxlKGggKiAoaCArIDEpIC8gMiA8PSB0b3RhbCkgKytoIDsKICAgIC0taCA7Ly8gdGltIGNoaWV1IGNhbyB0b2kgZGEgY3VhIHRoYXAgCgogICAgdmVjdG9yPGludD4gZHAociArIDUgLCAwKTsgLy8gZHBbaV0gOiBkdW5nIGkgbWF1IGRvIGRlIHhheSBkdW5nIGNhcCBkbwogICAgZHBbMF0gPSAxIDsgLy8gY2h1YSBzdSBkdW5nIGNhYyBtYXUgZG8gdGhpIGNoaSBjbyAxIGNhY2ggbGEga2hvbmcgbGFtIGdpCgogICAgZm9yKGludCBpID0gMSA7IGkgPD0gaCA7IGkrKyl7CiAgICAgICAgZm9yKGludCBqID0gciA7IGogPj0gaSA7IGotLSl7CiAgICAgICAgICAgIGRwW2pdICs9IGRwW2ogLSBpXTsKICAgICAgICAgICAgZHBbal0gJT0gTU9EIDsKICAgICAgICB9CiAgICB9CgogICAgaW50IGFucyA9IDAgOwogICAgaW50IG1heEJsb2NrcyA9IChoICsgMSkgKiBoIC8gMiA7CiAgICBmb3IoaW50IGkgPSAwIDsgaSA8PSByIDsgaSsrKXsKICAgICAgICBpbnQgZ3JlZW5CbG9jayA9IG1heEJsb2NrcyAtIGkgOwogICAgICAgIGlmKGdyZWVuQmxvY2sgPj0gMCAmJiBncmVlbkJsb2NrIDw9IGcpewogICAgICAgICAgICBhbnMgKz0gZHBbaV07CiAgICAgICAgICAgIGFucyAlPSBNT0QgOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgYW5zIDw8IGVuZGw7Cn0KCnNpZ25lZCBtYWluKCkgewogICAgZmFzdGVyKCk7CiAgICBpbnQgdGVzdCA9IDEgOwogICAgLy8gY2luID4+IHRlc3QgOwogICAgd2hpbGUodGVzdC0tKSAgIHNvbHZlKCk7CiAgICByZXR1cm4gMDsKfQo=