N, K = map(int, input().split()) A = input() if N == 1: print(1) else: dp = [[0 for i in range(N * (N - 1))] for j in range(N + 1)] cum = [[] for _ in range(N + 1)] dp[1][0] = 1 cum[1] = [0, 1, 1] j_max = 2 for i in range(2, N + 1): sum_val = 0 cum[i].append(0) for j in range(min(j_max, K + 1)): dp[i][j] = cum[i - 1][j + 1] - cum[i - 1][max(0, j - i + 1)] sum_val += dp[i][j] cum[i].append(sum_val) j_max += i cum[i] += [sum_val] * i print(sum(dp[N][0:K + 1]) % 1000000007)