#include <bits/stdc++.h>
using namespace std;
template <int MD>
struct ModInt {
  int v;
  ModInt(int _v = 0) : v(_v) {}
  ModInt &operator+=(const ModInt &r) {
    if ((v += r.v - MD) < 0) v += MD;
    return *this;
  }
  ModInt &operator-=(const ModInt &r) {
    if ((v -= r.v) < 0) v += MD;
    return *this;
  }
  ModInt &operator*=(const ModInt &r) {
    v = long long(v) * r.v % MD;
    return *this;
  }
  ModInt operator+(const ModInt &r) const { return ModInt(*this) += r; }
  ModInt operator-(const ModInt &r) const { return ModInt(*this) -= r; }
  ModInt operator*(const ModInt &r) const { return ModInt(*this) *= r; }
  ModInt pow(int n) const {
    ModInt x = *this, r = 1;
    while (n) {
      if (n & 1) r *= x;
      x *= x;
      n >>= 1;
    }
    return r;
  }
  ModInt inv() const { return this->pow(MD - 2); }
};
const int MN = 123;
const int MK = 123456;
int n, k;
ModInt<1000000007> dp[MN][MK];
ModInt<1000000007> fac[MK], ifac[MK];
void first() {
  fac[0] = 1;
  for (int i = 1; i < MK; i++) {
    fac[i] = fac[i - 1] * ModInt<1000000007>(i);
  }
  ifac[MK - 1] = fac[MK - 1].inv();
  for (int i = MK - 2; i >= 0; i--) {
    ifac[i] = ifac[i + 1] * ModInt<1000000007>(i + 1);
  }
}
ModInt<1000000007> binom(int n, int r) {
  return fac[n] * ifac[r] * ifac[n - r];
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  first();
  cin >> n >> k;
  if (k == 0) {
    cout << 1 << endl;
    return 0;
  }
  dp[0][k] = 1;
  for (int ph = 0; ph < n; ph++) {
    int a;
    cin >> a;
    for (int j = 0; j <= k; j++) {
      dp[ph + 1][j] += dp[ph][j];
      if (j >= a) {
        dp[ph + 1][j - a] -= dp[ph][j];
      }
    }
  }
  ModInt<1000000007> sm = 0;
  for (int i = 0; i <= k; i++) {
    sm += binom(i - 1 + n, n - 1) * dp[n][i];
  }
  cout << sm.v << endl;
  return 0;
}
