#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n;
long long s;
long long a[25];
long long Pow(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
long long C(long long a, long long b) {
  if (a < b) return 0;
  if (a == b) return 1;
  if (b > a - b) b = a - b;
  long long ans = 1, ca = 1, cb = 1;
  for (long long i = 0; i < b; i++) {
    ca = (ca * (a - i)) % mod;
    cb = (cb * (b - i)) % mod;
  }
  ans = (ca * Pow(cb, mod - 2)) % mod;
  return ans;
}
long long lucas(long long a, long long b) {
  long long ans = 1;
  while (ans && a && b) {
    ans = (ans * C(a % mod, b % mod)) % mod;
    a /= mod;
    b /= mod;
  }
  return ans;
}
long long solve() {
  long long ans = 0;
  for (int i = 0; i < (1 << n); i++) {
    long long sum = s;
    int sign = 1;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        sum -= a[j] + 1;
        sign = -sign;
      }
    }
    if (sum < 0) continue;
    ans = (ans + sign * lucas(sum + n - 1, sum)) % mod;
  }
  return (ans + mod) % mod;
}
int main() {
  scanf("%d%lld", &n, &s);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  printf("%lld\n", solve());
  return 0;
}
