import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N,K,*A = map(int,read().split())

MOD = 10**9 + 7

"""
・次々と(1+x+...+x^a)をかけていく
・(1-x^{a+1})をかけたあと(1-x)^{-1}をかける
"""

dp = np.zeros(K+10,np.int64)
dp[0] = 1
for a in A:
    dp[(a+1):] -= dp[:-(a+1)]
    dp %= MOD

for _ in range(N):
    np.cumsum(dp,out=dp); dp %= MOD

answer = dp[K]
print(answer)