#include <bits/stdc++.h>
const long long mod = (long long)(1e9 + 7);
int n;
long long s, ans;
long long f[1000];
long long ksm(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y = y / 2;
  }
  return ans;
}
long long Lucas(long long n, long long m) {
  if (n < mod && m < mod) {
    if (n < m) return 0;
    if (n == m) return 1;
    if (m == 0) return 1;
    long long nj = 1, mj = 1;
    long long a = n - m, b = m;
    if (a > b) std::swap(a, b);
    long long i = b + 1;
    while (i <= n) {
      nj = (nj * i) % mod;
      i++;
    }
    i = 2;
    while (i <= a) {
      mj = (mj * i) % mod;
      i++;
    }
    return ksm(mj, mod - 2) * nj % mod;
  }
  return Lucas(n % mod, m % mod) * Lucas(n / mod, m / mod) % mod;
}
long long dle(long long x) { return (((1 & x) ^ 1) << 1) - 1; }
void dfs(int p, int l, long long sum) {
  if (p == n + 1) {
    ans = (ans + dle(l) * Lucas(s - sum + n - 1, n - 1)) % mod;
    return;
  }
  dfs(p + 1, l, sum);
  dfs(p + 1, l + 1, sum + f[p] + 1);
  return;
}
int main() {
  scanf("%d%I64d", &n, &s);
  for (int i = 1; i <= n; i++) scanf("%I64d", &f[i]);
  ans = 0;
  dfs(1, 0, 0);
  printf("%I64d\n", (ans % mod + mod) % mod);
  return 0;
}
