#include <bits/stdc++.h>
using namespace std;
const int N = 20, mod = 1e9 + 7;
long long s[N];
int down = 1;
int qmi(int a, int b, int p) {
  int res = 1;
  while (b) {
    if (b & 1) res = (long long)res * a % p;
    a = (long long)a * a % p;
    b >>= 1;
  }
  return res;
}
int C(long long a, long long b) {
  if (a < b) return 0;
  int up = 1;
  for (long long i = a; i > a - b; i--) up = i % mod * up % mod;
  return (long long)up * down % mod;
}
int main() {
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 1; i <= n - 1; i++) down = (long long)down * i % mod;
  down = qmi(down, mod - 2, mod);
  int res = 0;
  for (int i = 0; i < 1 << n; i++) {
    long long a = m + n - 1, b = n - 1;
    int sign = 1;
    for (int j = 0; j < n; j++) {
      if (i >> j & 1) {
        sign *= -1;
        a -= s[j] + 1;
      }
    }
    res = (res + C(a, b) * sign) % mod;
  }
  cout << (res + mod) % mod << endl;
  return 0;
}
