#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long n, m, k;
long long qpow(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return res;
}
long long inv[25];
long long C(long long n, long long m) {
  if (n < m || n < 0 || m < 0) return 0;
  if (n == m || m == 0) return 1;
  n %= mod;
  long long res = 1;
  long long Inv = 1;
  for (int i = 1; i <= m; ++i) {
    Inv = Inv * inv[i] % mod;
  }
  for (long long i = 0; i < m; ++i) {
    res = res * (n - i) % mod;
  }
  return res * Inv % mod;
}
long long a[25];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    inv[i] = qpow(i, mod - 2) % mod;
  }
  long long ans = C(n + m - 1, n - 1);
  for (int s = 1; s < (1 << n); ++s) {
    int cnt = 0;
    long long sum = 0;
    for (int i = 1; i <= n; ++i) {
      if (s >> (i - 1) & 1) {
        cnt++;
        sum += a[i] + 1;
      }
    }
    if (cnt % 2)
      ans = ((ans - C(n + m - 1 - sum, n - 1)) % mod + mod) % mod;
    else
      ans = (ans + C(n + m - 1 - sum, n - 1)) % mod;
  }
  cout << (ans + mod) % mod << endl;
  return 0;
}
