#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m, a[25];
long long lim, num[(1 << 20) + 10], Inv[25];
long long Pow(long long a, long long n) {
  long long ans = 1;
  for (; n; n >>= 1, a = a * 1ll * a % mod)
    if (n & 1) ans = ans * 1ll * a % mod;
  return ans;
}
long long Calc(long long S) {
  long long Del = 0;
  for (long long i = 1; i <= n; i++)
    if (S & (1 << i - 1)) Del += a[i] + 1;
  long long N = m - 1 + n - Del, M = n - 1, Bas = 1;
  if (N < 0 || N < M) return 0;
  for (long long i = 1; i <= M; i++, N--) Bas = N % mod * Bas % mod;
  return Bas * Inv[M] % mod;
}
signed main() {
  scanf("%lld%lld", &n, &m);
  Inv[0] = 1;
  for (long long i = 1; i <= n; i++)
    scanf("%lld", &a[i]), Inv[i] = Inv[i - 1] * 1ll * Pow(i, mod - 2) % mod;
  lim = 1 << n;
  long long ans = 0;
  for (long long S = 0; S < lim; S++) {
    num[S] = num[S >> 1] + (S & 1);
    ans = ((ans + ((num[S] & 1) ? -1 : 1) * 1ll * Calc(S)) % mod + mod) % mod;
  }
  printf("%lld\n", ans);
  return 0;
}
