#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll N;
  cin >> N;
  ll K;
  cin >> K;
  vector<ll> A(N);
  for (ll i = 0; i < N; i++) cin >> A[i];
  if (K == 0) {
    cout << 1 << '\n';
    return 0;
  }
  ll MOD = 1e9 + 7;
  vector<ll> dp(K + 1, 0), dp2(K + 1, 0);
  dp2[0] = 1;
  for (ll i = 0; i < N; i++) {
    vector<ll> S(K + 2, 0);
    for (ll j = 0; j < K; j++) {
      (S[j + 1] += (S[j] + dp2[j])) %= MOD;
      (S[j + 1] += MOD) %= MOD;
      dp[j + 1] = 0;
    }
    dp[0] = 0;
    S[K + 1] = S[K];
    for (ll j = 0; j <= K; j++) {
      ll l = max(0ll, j - A[i]);
      ll r = j + 1;
      (dp[j] += (S[r] - S[l])) %= MOD;
      (dp[j] += MOD) %= MOD;
    }
    dp2 = dp;
  }
  for (ll i = 0; i < 10; i++) {
    cout << dp[i] << '\n';
  }
  cout << dp[K] << '\n';
  return 0;
}
