#include <bits/stdc++.h>
using namespace std;
int static const p = 1000000007;
long long int gcd(long long int a, long long int b) {
  if (a % b == 0) return b;
  return gcd(b, a % b);
}
long long int nad(long long int n, long long int k) {
  long long int ll[30], w = 1;
  if (n < k) return 0;
  long long int dodi = 1;
  for (int i = 0; i < k; i++) {
    ll[i] = n - i;
    w *= (i + 1);
  }
  for (int i = 0; i < k; i++) {
    long long int gd;
    gd = gcd(max(ll[i], w), min(ll[i], w));
    w /= gd;
    ll[i] /= gd;
    dodi *= ll[i];
    dodi = dodi % p;
  }
  return dodi;
}
int n;
long long int f[30], uk, s;
void prodji(int br, long long int suma, int rb) {
  if (rb == n) {
    long long int q = (s - suma + n - 1) % p;
    if (br % 2 == 0)
      uk += nad(q, n - 1);
    else
      uk -= nad(q, n - 1);
    uk = uk % p;
  } else {
    prodji(br, suma, rb + 1);
    prodji(br + 1, suma + f[rb], rb + 1);
  }
}
int main() {
  scanf("%i", &n);
  cin >> s;
  for (int i = 0; i < n; i++) {
    cin >> f[i];
    f[i]++;
  }
  long long int pp = 0, q = 0, r = 0;
  prodji(pp, q, r);
  while (uk < 0) uk += p;
  cout << uk << "\n";
  return 0;
}
