#include <bits/stdc++.h>
const int mod = 1e9 + 7;
int n, c, dp[2][10005];
int main(){
scanf("%d%d", &n, &c); dp[0][0] = 1;
for (int i = 1; i <= n; i++)
for (int j = 0; j <= c; j++)
dp[i%2][j]=j?((dp[(i+1)%2][j]-(j>=i?dp[(i+1)%2][j-i]:0)+mod)%mod+dp[i%2][j-1])%mod:1;
printf("%d", dp[n%2][c] - dp[n%2][c + 1]);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CmNvbnN0IGludCBtb2QgPSAxZTkgKyA3OwppbnQgbiwgYywgZHBbMl1bMTAwMDVdOwppbnQgbWFpbigpewoJc2NhbmYoIiVkJWQiLCAmbiwgJmMpOyBkcFswXVswXSA9IDE7Cglmb3IgKGludCBpID0gMTsgaSA8PSBuOyBpKyspCgkJZm9yIChpbnQgaiA9IDA7IGogPD0gYzsgaisrKQoJCQlkcFtpJTJdW2pdPWo/KChkcFsoaSsxKSUyXVtqXS0oaj49aT9kcFsoaSsxKSUyXVtqLWldOjApK21vZCklbW9kK2RwW2klMl1bai0xXSklbW9kOjE7CglwcmludGYoIiVkIiwgZHBbbiUyXVtjXSAtIGRwW24lMl1bYyArIDFdKTsKfQ==