#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 22;
int inv[22];
long long a[22];
long long re() {
  long long x = 0;
  char c = getchar();
  bool p = 0;
  for (; c < '0' || c > '9'; c = getchar()) p = (c == '-' || p) ? 1 : 0;
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + (c - '0');
  return p ? -x : x;
}
int C(long long y, int x) {
  if (y < 0 || x < 0 || y < x) return 0;
  y %= mod;
  if (y == 0 || x == 0) return 1;
  int ans = 1;
  for (int i = 0; i < x; i++) ans = (long long)ans * (y - i) % mod;
  for (int i = 1; i <= x; i++) ans = (long long)ans * inv[i] % mod;
  return ans;
}
int main() {
  int i, n, x, o, y;
  long long k, s = 0, m;
  inv[1] = 1;
  for (i = 2; i <= 20; i++) inv[i] = 1LL * (mod - mod / i) * inv[mod % i] % mod;
  n = re();
  m = re();
  for (i = 1; i <= n; i++) a[i] = re();
  for (x = 0, o = 1 << n; x < o; x++) {
    if (!x)
      s = (s + C(n + m - 1, n - 1)) % mod;
    else {
      k = n + m;
      y = 0;
      for (i = 0; i < n; i++)
        if ((x >> i) & 1) {
          y++;
          k -= a[i + 1];
        }
      k -= y + 1;
      if (y & 1)
        (s -= C(k, n - 1)) %= mod;
      else
        (s += C(k, n - 1)) %= mod;
    }
  }
  printf("%I64d", (s + mod) % mod);
  return 0;
}
