#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9 + 7;
ll read() {
  ll x = 0;
  char c;
  for (c = getchar(); !isdigit(c); c = getchar())
    ;
  for (; isdigit(c); c = getchar()) x = (x << 3) + (x << 1) + (c ^ 48);
  return x;
}
ll pow(ll b, int e) {
  return e ? pow(b * b % mod, e >> 1) * (e & 1 ? b : 1) % mod : 1;
}
int N, rev[25];
ll num[25], r;
void prework() {
  int temp = 1;
  for (int i = 1; i <= N; ++i)
    temp = 1ll * temp * i % mod, rev[i] = pow(temp, mod - 2);
}
int combo(ll n, ll m) {
  if (n < 0 || m < 0 || n < m) return 0;
  if (!m) return 1;
  ll ret = rev[m];
  for (int i = 0; i < m; ++i) ret = (n - i) % mod * ret % mod;
  return ret;
}
int main() {
  N = read(), r = read();
  for (int i = 0; i < N; ++i) num[i] = read();
  prework();
  int bd = 1 << N, k;
  ll ans = 0, tot;
  for (int i = 0; i < bd; ++i) {
    k = __builtin_popcount(i), tot = 0;
    for (int j = 0; j < N; ++j)
      if (i >> j & 1) tot += num[j] + 1;
    ans = (ans + (k % 2 ? -1 : 1) * combo(r + N - tot - 1, N - 1)) % mod;
  }
  cout << (ans + mod) % mod;
}
