#include <bits/stdc++.h>
using namespace std;
const int MAXN = 25, MOD = 1e9 + 7;
long long powe(long long val, int t) {
  long long res = 1;
  for (; t; t /= 2) {
    if (t % 2 == 1) {
      res *= val;
      res %= MOD;
    }
    val *= val;
    val %= MOD;
  }
  return res;
}
long long comb(long long a, int b) {
  if (a < b) return 0;
  long long u = 1, d = 1;
  for (long long i = a - b + 1; i <= a; i++) u *= (i % MOD), u %= MOD;
  for (long long j = 1; j <= b; j++) d *= j, d %= MOD;
  d = powe(d, MOD - 2);
  return (u * d) % MOD;
}
long long f[MAXN], n, res, s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) cin >> f[i];
  for (int i = 0; i < (1 << n); i++) {
    long long all = s;
    int k = 0;
    for (int j = 0; j < n; j++)
      if ((i & (1 << j)) != 0) all -= f[j] + 1, k++;
    if (k % 2 == 0)
      res += comb(all + n - 1, n - 1);
    else
      res -= comb(all + n - 1, n - 1);
    res %= MOD;
  }
  if (res < 0) res += MOD;
  cout << res;
}
