#include <bits/stdc++.h>
using namespace std;
int n;
long long m, f[20 + 5], inv[20 + 5], ans;
long long fst_pow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % 1000000007;
    a = a * a % 1000000007;
    b >>= 1;
  }
  return res;
}
long long Comb(long long a, long long b) {
  if (a < 0 || a < b) return 0;
  long long res = 1;
  for (long long i = a - b + 1; i <= a; i++)
    res = (res * (i % 1000000007)) % 1000000007;
  for (int i = 1; i <= b; ++i) res = (res * inv[i]) % 1000000007;
  return res;
}
int main() {
  scanf("%d%lld", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%lld", &f[i]);
  for (int i = 1; i <= n; i++) inv[i] = fst_pow(i, 1000000007 - 2);
  ans = Comb(n + m - 1, n - 1);
  for (int S = 1; S < (1 << n); S++) {
    long long ns = n + m - 1, F = 0;
    for (int i = 0; i < n; i++)
      if (S & (1 << i)) ns -= f[i + 1] + 1, F ^= 1;
    if (F)
      ans = (ans - Comb(ns, n - 1) + 1000000007) % 1000000007;
    else
      ans = (ans + Comb(ns, n - 1) + 1000000007) % 1000000007;
  }
  printf("%lld", ans);
}
