#include <bits/stdc++.h>
using namespace std;
const int MAXN = 21;
const int MAXB = 30;
const int MOD = 1E9 + 7;
int N;
long long S;
long long ar[MAXN];
long long inv[MAXN];
void mmult(long long& a, long long b) {
  a %= MOD;
  b %= MOD;
  a *= b;
  a %= MOD;
}
long long mpow(long long base, int exp) {
  long long ret = 1;
  long long cur = base;
  for (int i = 0; i <= MAXB; ++i) {
    if (exp & 1 << i) {
      mmult(ret, cur);
    }
    mmult(cur, cur);
  }
  return ret;
}
long long choose(long long n, int k) {
  long long ret = 1;
  for (int i = 0; i < k; ++i) {
    mmult(ret, n - i);
    mmult(ret, inv[i + 1]);
  }
  return ret;
}
long long solve(int pos, long long cur) {
  if (cur < 0) return 0;
  if (pos == N) {
    return choose(cur + N - 1, N - 1);
  }
  long long ret = (solve(pos + 1, cur) - solve(pos + 1, cur - ar[pos])) % MOD;
  if (ret < 0) ret += MOD;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> N >> S;
  for (int i = 0; i < N; ++i) {
    cin >> ar[i];
    ++ar[i];
  }
  for (int i = 1; i <= N; ++i) {
    inv[i] = mpow(i, MOD - 2);
  }
  long long res = solve(0, S);
  cout << res << endl;
  return 0;
}
