#include <bits/stdc++.h>
using namespace std;
long long int bigmod(long long int a, long long int p, long long int m) {
  if (p == 0) return 1 % m;
  long long int x = bigmod(a, p / 2, m);
  x = (x * x) % m;
  if (p & 1) x = (x * a) % m;
  return x;
}
long long int inverse[55];
long long int calculate(long long int n, long long int r) {
  if (r < 0 || n < r) return 0;
  if (n - r < r) r = n - r;
  long long int ans = 1;
  n = n % 1000000007;
  for (int i = 0; i < r; i++) {
    ans = (ans * (n - i)) % 1000000007;
    ans = (ans * inverse[i + 1]) % 1000000007;
  }
  return ans % 1000000007;
}
void initialization() {
  for (int i = 0; i < 55; i++)
    inverse[i] = bigmod(i, 1000000007 - 2, 1000000007);
}
long long int fi[30], s;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n >> s;
  for (int i = 0; i < n; i++) cin >> fi[i];
  long long int ans = 0;
  initialization();
  for (int i = 0; i < (1 << n); i++) {
    long long int x = 0, cnt = 0;
    for (int j = 0; j < n; j++) {
      if (i & (1 << j)) {
        cnt++;
        x += fi[j] + 1;
      }
    }
    if (s - x < 0) continue;
    long long int ret = calculate(s - x + n - 1, n - 1);
    if (cnt & 1)
      ans = (ans - ret + 1000000007) % 1000000007;
    else
      ans = (ans + ret) % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
