#include <iostream>
#include <algorithm>
#define llong long long
using namespace std;
int n, k;
llong dp[10006], tmp[10006];
const int mod = 1e9+7;
int main() {
cin >> n >> k;
for(int i=1; i<=n; ++i) {
tmp[0] = 1;
for(int j=1; j<=k; ++j) {
llong val = (dp[j] - ((j - i >= 0) ? dp[j-i] : 0) + mod) % mod;
tmp[j] = (tmp[j-1] + val) % mod;
}
for(int j=0; j<=k; ++j) dp[j] = tmp[j];
}
cout << (dp[k] - ((k > 0) ? dp[k-1] : 0) + mod) % mod;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojZGVmaW5lIGxsb25nIGxvbmcgbG9uZwoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBuLCBrOwpsbG9uZyBkcFsxMDAwNl0sIHRtcFsxMDAwNl07CmNvbnN0IGludCBtb2QgPSAxZTkrNzsKCmludCBtYWluKCkgewogICAgY2luID4+IG4gPj4gazsKICAgIGZvcihpbnQgaT0xOyBpPD1uOyArK2kpIHsKICAgICAgICB0bXBbMF0gPSAxOwogICAgICAgIGZvcihpbnQgaj0xOyBqPD1rOyArK2opIHsKICAgICAgICAgICAgbGxvbmcgdmFsID0gKGRwW2pdIC0gKChqIC0gaSA+PSAwKSA/IGRwW2otaV0gOiAwKSArIG1vZCkgJSBtb2Q7CiAgICAgICAgICAgIHRtcFtqXSA9ICh0bXBbai0xXSArIHZhbCkgJSBtb2Q7CiAgICAgICAgfQogICAgICAgIGZvcihpbnQgaj0wOyBqPD1rOyArK2opIGRwW2pdID0gdG1wW2pdOwogICAgfQogICAgY291dCA8PCAoZHBba10gLSAoKGsgPiAwKSA/IGRwW2stMV0gOiAwKSArIG1vZCkgJSBtb2Q7CiAgICByZXR1cm4gMDsKfQ==