N, K = map(int, input().split())
A = list(map(int, input().split()))
mod = int(1e+9) + 7
LL = [0 for _ in range(K + N + 1)]
LL[0] = 1
P = [0]
for i in range(N):
  L = [[_, LL[_]] for _ in P]
  for j in L:
    if j[0] + A[i] + 1 <= K + N: #or j[0] + A[i] + 1 > K + N:
      LL[j[0]+A[i]+1] -= j[1]
      if j[0] + A[i] + 1 not in P:
        P.append(j[0]+A[i]+1)
def inved(x):
  p = mod - 2
  y = 1
  base = x
  while p != 0:
    if p % 2 == 1:
      y *= base
      y %= mod
    base *= base
    base %= mod
    p //= 2
  return y
fact = [1 for i in range(K + N)]
invf = [1 for i in range(K + N)]
for i in range(K + N - 1):
  fact[i+1] = (fact[i] * (i + 1)) % mod
invf[-1] = inved(fact[-1])
for i in range(K + N - 1, 0, -1):
  invf[i-1] = (invf[i] * i) % mod
P = 0
for i in range(K+1):
  P += (LL[i] * fact[K-i+N-1] * invf[K-i]) % mod
  P %= mod
print((P*invf[N-1])%mod)