#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int INV[25], n;
int inv(int x) {
  if (INV[x] != -1) return INV[x];
  if (x == 1) return INV[1] = 1;
  return (long long)(mod - mod / x) * inv(mod % x) % mod;
}
int choose(long long s, int n) {
  int res = 1;
  for (int i = 0; i < n; i++) {
    res = (s - i) % mod * res % mod * inv(i + 1) % mod;
  }
  return res;
}
long long a[25];
int go(int x, long long s) {
  if (s < 0) return 0;
  if (x == n) {
    return choose(s + n - 1, n - 1);
  }
  return (go(x + 1, s) - go(x + 1, s - a[x]) + mod) % mod;
}
long long s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  memset(INV, -1, sizeof(INV));
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]++;
  }
  cout << go(0, s) << endl;
  return 0;
}
