#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long dat[22];
pair<long long, long long> extended_gcd(long long a, long long b) {
  if (b == 0) return make_pair(1, 0);
  pair<long long, long long> t = extended_gcd(b, a % b);
  return make_pair(t.second, t.first - t.second * (a / b));
}
long long modinverse(long long a, long long m) {
  return (extended_gcd(a, m).first % m + m) % m;
}
long long comb(long long a, long long b) {
  if (b < 0 || b > a) return 0;
  b = a - b;
  long long res = 1;
  for (long long i = a - b + 1; i <= a; i++) {
    res = (res * (i % mod)) % mod;
  }
  for (long long i = 1; i <= b; i++) {
    res = (res * (modinverse(i, mod) % mod)) % mod;
  }
  return res;
}
int main() {
  int n;
  long long s;
  scanf("%d%lld", &n, &s);
  for (int i = 0; i < n; i++) {
    scanf("%lld", &dat[i]);
  }
  long long ans = 0;
  for (int i = 0; i < (1 << n); i++) {
    int cnt = 0;
    long long sum = 0;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        cnt++;
        sum += dat[j];
      }
    }
    long long v = s - (sum + cnt);
    if (cnt % 2)
      ans -= comb((n - 1) + v, v);
    else
      ans += comb((n - 1) + v, v);
  }
  ans %= mod;
  ans += mod;
  ans %= mod;
  printf("%lld\n", ans);
  return 0;
}
