MOD = 1000000007
def pow_mod(a, k, p):
t = []
pow_val = 1 # 2的次幂数, 初始是2^0 = 1
a_pow = a % p # a^(2 ^ i)的数值, 初始是a^(2^0) = a
while pow_val <= k:
t.append(a_pow)
a_pow = (a_pow * a_pow) % p
pow_val <<= 1
ans = 1
for i in range(len(t)):
if k & 1:
ans = (ans * t[i]) % p
k >>= 1
return ans
# 提前把20以内阶乘的逆元都算好
_vals = [1] * 21
k = 1
for ii in range(1, 21):
k = (k * ii) % MOD
_vals[ii] = pow_mod(k, MOD-2, MOD)
def C(a, b, p):
b = min(b, a - b)
i, j = 1, a
val, _val = 1, _vals[b]
while i <= b:
val = (val * j) % p
i, j = i + 1, j - 1
# 乘法逆元做除法
val = (val * _val) % p
return val
N, M = map(int, input().split())
A = list(map(int, input().split()))
total_method_num = C(M + N - 1, N - 1, MOD)
invalid_method_num = 0
for stat in range(1, 1 << N):
# print(bin(stat))
one_cnt = 0
S = 0
for i in range(N):
if stat & (1 << i):
one_cnt += 1
S += A[i] + 1
if S <= M:
bad_method_num = C(M + N - S - 1, N - 1, MOD)
if one_cnt & 1:
total_method_num -= bad_method_num
total_method_num %= MOD
else:
total_method_num += bad_method_num
total_method_num %= MOD
print(total_method_num)