#include <bits/stdc++.h>
const int mod = 1000000007;
int n;
long long s;
long long f[25];
long long ksm(long long b, int p) {
  long long ret = 1;
  while (p) {
    if (p & 1) ret = (ret * b) % mod;
    b = (b * b) % mod;
    p >>= 1;
  }
  return ret;
}
long long c(long long cn, long long cm) {
  if (cm > cn) return 0;
  if (cn >= mod) return c(cn % mod, cm % mod) * c(cn / mod, cm / mod) % mod;
  if (cm > cn - cm) cm = cn - cm;
  long long ca = 1, cb = 1;
  for (long long i = 1; i <= cm; i++)
    ca = ca * (cn - i + 1) % mod, cb = cb * i % mod;
  return ca * ksm(cb, mod - 2) % mod;
}
int main() {
  scanf("%d%I64d", &n, &s);
  for (int i = 1; i <= n; i++) scanf("%I64d", &f[i]);
  long long ans = 0;
  for (int i = 0; i < (1 << n); i++) {
    int fl = 1, t = i;
    long long tot = s;
    for (int j = 1; j <= n; j++) {
      if (i & (1 << (j - 1))) {
        tot -= (f[j] + 1);
        fl = -fl;
      }
    }
    if (tot < 0) continue;
    ans = ((ans + c(tot + n - 1, n - 1) % mod * fl) % mod + mod) % mod;
  }
  printf("%I64d", ans);
  return 0;
}
