#include <bits/stdc++.h>
using namespace std;
int fact[25];
int powfun(long long base, int pow) {
  if (pow == 0) return 1;
  if (pow & 1) return ((long long)base * powfun(base, pow - 1)) % 1000000007;
  long long x = powfun(base, pow / 2) % 1000000007;
  return (int)((x * x) % 1000000007);
}
long long C(long long n, int r) {
  long long x = 1;
  for (int i = 0; i < r; i++) x *= (n - i) % 1000000007, x %= 1000000007;
  return (int)((x * powfun(fact[r], 1000000007 - 2)) % 1000000007);
}
int main() {
  int n;
  long long s;
  scanf("%d %I64d", &n, &s);
  long long res = 0;
  long long a[n];
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  fact[1] = fact[0] = 1;
  for (int i = 2; i <= 20; i++)
    fact[i] = ((long long)fact[i - 1] * i) % 1000000007;
  for (int i = 0; i < (1 << n); i++) {
    long long x = s;
    int counter = 0;
    for (int j = 0; j < n; j++)
      if (i & (1 << j)) x -= a[j] + 1, counter++;
    if (x < 0) continue;
    if (counter & 1)
      res -= C(x + n - 1, n - 1), res %= 1000000007, res += 1000000007,
          res %= 1000000007;
    else
      res += C(x + n - 1, n - 1), res %= 1000000007;
  }
  cout << res;
  return 0;
}
