#include <bits/stdc++.h>
using namespace std;
const int maxn = 1100005;
const int ha = 1000000007;
int ci[33], tag[maxn], n, inv[33];
long long sum[maxn], S, ans = 0;
inline int add(int x, int y) {
  x += y;
  return x >= ha ? x - ha : x;
}
inline void init() {
  ci[0] = 1;
  for (int i = 1; i <= 20; i++) ci[i] = ci[i - 1] << 1;
  inv[1] = 1;
  for (int i = 2; i <= 20; i++)
    inv[i] = -inv[ha % i] * (long long)(ha / i) % ha + ha;
}
inline int C(int x, int y) {
  int an = 1;
  for (int i = 1; i <= y; i++)
    an = an * (long long)(x - i + 1) % ha * (long long)inv[i] % ha;
  return an;
}
inline void solve() {
  tag[0] = 1, sum[0] = 0;
  for (int i = 0; i < ci[n]; i++) {
    if (i) tag[i] = -tag[i ^ (i & -i)];
    sum[i] = sum[i ^ (i & -i)] + sum[i & -i];
    if (sum[i] <= S)
      ans = add(ans, add(tag[i] * C((S - sum[i] + n - 1) % ha, n - 1), ha));
  }
}
int main() {
  init();
  scanf("%d%I64d", &n, &S);
  for (int i = 0; i < n; i++) scanf("%I64d", sum + ci[i]), sum[ci[i]]++;
  solve();
  printf("%I64d\n", ans);
  return 0;
}
