mod = 10**9+7 n, k = map(int, input().split()) dp = [1]*(k+1) for i in range(1, n+1): for j in range(1, k+1): dp[j] += dp[j-1] dp[j] %= mod for j in range(k+1)[::-1]: if j-i+1 > 0: dp[j] -= dp[j-i] dp[j] %= mod print(dp[k])