#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long a[50];
long long inv[50];
long long Finv[50];
long long n, s;
void init() {
  inv[1] = 1;
  for (int i = 2; i <= 50; i++) {
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
  }
  Finv[0] = 1;
  for (int i = 1; i <= 50; i++) {
    Finv[i] = Finv[i - 1] % mod * inv[i] % mod;
  }
}
long long C(long long n, long long m) {
  if (n < 0 || m < 0 || m > n) return 0;
  long long res = 1;
  for (long long i = n; i > n - m; i--) {
    res = (i % mod * res) % mod;
  }
  res = res % mod * Finv[m] % mod;
  return res % mod;
}
int main() {
  init();
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long res = 0;
  for (long long i = 0; i < (1ll << n); i++) {
    long long tmp = s;
    long long cnt = 0;
    for (long long j = 0; j < n; j++) {
      if ((1ll << j) & i) {
        tmp -= a[j] + 1;
        cnt++;
      }
    }
    if (tmp < 0) continue;
    if (cnt & 1) {
      res = (((res - C(tmp + n - 1, n - 1)) % mod + mod) % mod) % mod;
    } else {
      res = (res + C(tmp + n - 1, n - 1) % mod) % mod;
    }
  }
  cout << res << endl;
}
