mod = 10**9+7

def comb(a,b):
      return fact[a]*inv[b]*inv[a-b]%mod
  
n,k = map(int, input().split())
a = list(map(int, input().split()))
fact = [1]
for i in range(n+k):
    fact.append(fact[-1]*(i+1)%mod)
inv = [1]*(n+k+1)
inv[n+k] = pow(fact[n+k],mod-2,mod)
for i in range(n+k)[::-1]:
    inv[i] = inv[i+1]*(i+1)%mod
f = [comb(i+n-1,n-1) for i in range(k+1)]
for i in a:
    for j in range(k-i)[::-1]:
        f[j+i+1] -= f[j]
        f[j+i+1] %= mod
print(f[k])