#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const long long MOD = 1000000007LL;
int n;
long long s, f[N];
long long inv(long long x) {
  return x == 1 ? 1 : (MOD - MOD / x) * inv(MOD % x) % MOD;
}
long long binom(long long n, long long m) {
  if (n < 0 || m < 0 || m > n) return 0;
  long long ret = 1;
  for (long long i = n; i > n - m; i--) ret = ret * (i % MOD) % MOD;
  for (long long i = 0; i < m; i++) ret = ret * inv(i + 1) % MOD;
  return ret;
}
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) cin >> f[i];
  long long ans = 0;
  for (int i = 0; i < 1 << n; i++) {
    int cnt = 0;
    long long p = 0;
    for (int j = 0; j < n; j++)
      if (i & (1 << j)) cnt++, p += f[j] + 1;
    if (cnt & 1)
      ans -= binom(s - p + n - 1, n - 1);
    else
      ans += binom(s - p + n - 1, n - 1);
    ans = (ans % MOD + MOD) % MOD;
  }
  cout << ans << endl;
  return 0;
}
