#include <bits/stdc++.h>
const int inf = 0xfffffff;
const long long INF = 1ll << 61;
using namespace std;
long long num[22];
void init() { memset(num, 0ll, sizeof(num)); }
int inv(int a) {
  return a == 1 ? 1
                : (long long)(1000000007 - 1000000007 / a) *
                      inv(1000000007 % a) % 1000000007;
}
long long C(long long n, long long m) {
  if (m < 0) return 0;
  if (n < m) return 0;
  if (m > n - m) m = n - m;
  long long up = 1, down = 1;
  for (long long i = 0; i < m; i++) {
    up = up * (n - i) % 1000000007;
    down = down * (i + 1) % 1000000007;
  }
  return up * inv(down) % 1000000007;
}
long long lucas(long long n, long long m, long long p) {
  long long ret = 1;
  while (n && m) {
    long long a = n % p, b = m % p;
    if (a < b) return 0;
    ret = ret * C(a, b) % p;
    n /= p;
    m /= p;
  }
  return ret;
}
long long ans;
long long n;
long long s;
void cal() {
  ans = 0ll;
  for (int i = 0; i < (1 << n); i++) {
    long long ts = s;
    int tmp = 1;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        ts -= num[j] + 1;
        tmp *= -1;
      }
    }
    if (ts < 0) continue;
    ans = (ans + tmp * lucas(ts + n - 1, n - 1, 1000000007) % 1000000007) %
          1000000007;
  }
}
int main() {
  while (scanf("%I64d %I64d", &n, &s) == 2) {
    init();
    for (int i = 0; i < n; i++) scanf("%I64d", &num[i]);
    cal();
    printf("%I64d\n", (ans + 1000000007) % 1000000007);
  }
  return 0;
}
