#include <bits/stdc++.h>
using namespace std;
const int N = 25, mod = 1e9 + 7;
long long n;
long long m, a[N], divide = 1;
long long qmi(long long a, int b) {
  long long res = 1;
  for (; b; b >>= 1) {
    if (b & 1) res = (res * a) % mod;
    a = a % mod * a % mod;
  }
  return res;
}
long long C(long long x, long long y) {
  long long res = 1;
  if (x < y) return 0;
  for (long long i = 0; i < y; i++) {
    res = res % mod * ((x - i) % mod) % mod;
  }
  return res * divide % mod;
}
int main() {
  scanf("%lld%lld", &n, &m);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i < n; i++) divide = (long long)divide * i % mod;
  divide = qmi(divide, mod - 2);
  long long res = 0;
  for (int s = 0; s < (1 << n); s++) {
    long long minus = n + m - 1, sig = 1;
    for (int i = 0; i < n; i++)
      if ((s >> i) & 1) sig *= -1, minus -= (a[i] + 1ll);
    long long t = C(minus, n - 1);
    res = (res + t * sig) % mod;
  }
  printf("%lld\n", (res % mod + mod) % mod);
  return 0;
}
