#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int M = 1000000007;
int n, k, A[102], sum = 0;
ll fact[100103], dp[102][100003], ans = 0;
ll power(ll x) {
  if (x == 1) return 1;
  ll num = 1;
  int mult = M - 2;
  while (mult) {
    if (mult & 1) {
      num = num * x % M;
    }
    mult = mult >> 1;
    x = x * x % M;
  }
  return num;
}
int nCr(int N, int R) {
  if (dp[R][N]) return dp[R][N];
  dp[R][N] = fact[N] * (power(fact[R]) * power(fact[N - R]) % M) % M;
  return dp[R][N];
}
int main() {
  cin >> n >> k;
  for (int i = 1; i < n + 1; i++) {
    cin >> A[i];
    sum += A[i];
  }
  if (sum < k || k == 0) {
    cout << 0;
    return 0;
  }
  if (n == 1) return 1;
  fact[0] = 1;
  for (int i = 1; i < 100102; i++) {
    fact[i] = fact[i - 1] * i % M;
  }
  ans = nCr(k + n - 1, n - 1);
  for (int i = 1; i < n + 1; i++) {
    for (int j = A[i] + 1; j < k + 1; j++) {
      ans = (ans - nCr(k - j + n - 2, n - 2)) % M;
    }
  }
  cout << ans;
}
