MOD = 10**9+7 n,k = map(int,input().split()) a = [1] for i in range(n): a += [0]*i for j in range(i+1,len(a))[::-1]: a[j] -= a[j-i-1] for j in range(1,len(a)): a[j] += a[j-1] a[j] %= MOD print(sum(a[:k+1])%MOD)