#include <bits/stdc++.h>
const long long yyb = 1000000007;
long long a[21], n, m, inv[21];
inline long long ksm(long long ba, long long k) {
  long long ans = 1;
  while (k) {
    if (k & 1) ans = ans * ba % yyb;
    ba = ba * ba % yyb;
    k >>= 1;
  }
  return ans;
}
inline long long C(long long n, long long m) {
  if (n < 0 || m < 0 || n < m) return 0;
  if (m == 0) return 1;
  n %= yyb;
  long long ans = 1;
  for (register long long i = 0; i < m; ++i) ans = ans * (n - i) % yyb;
  for (register long long i = 1; i <= m; ++i) ans = ans * inv[i] % yyb;
  return ans;
}
signed main() {
  for (register long long i = 1; i <= 20; ++i) inv[i] = ksm(i, yyb - 2);
  scanf("%lld%lld", &n, &m);
  for (register long long i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  long long ans = 0;
  for (register long long x = 0; x < (1 << n); ++x) {
    if (!x)
      ans = (ans + C(n + m - 1, n - 1)) % yyb;
    else {
      long long t = n + m, p = 0;
      for (register long long i = 0; i < n; ++i)
        if ((x >> i) & 1) ++p, t -= a[i + 1];
      t -= p + 1;
      if (p & 1)
        ans = (ans - C(t, n - 1)) % yyb;
      else
        ans = (ans + C(t, n - 1)) % yyb;
    }
  }
  printf("%lld\n", (ans + yyb) % yyb);
  return 0;
}
