#include <bits/stdc++.h>
using namespace std;
void fastscan(int &x) {
  bool neg = false;
  register int c;
  x = 0;
  c = getchar();
  if (c == '-') {
    neg = true;
    c = getchar();
  }
  for (; (c > 47 && c < 58); c = getchar()) x = (x << 1) + (x << 3) + c - 48;
  if (neg) x *= -1;
}
void optimizeIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
vector<vector<long long> > dp(100005, vector<long long>(101, -1));
vector<long long> inp(101);
int main() {
  optimizeIO();
  int n, k, x;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> inp[i];
  for (int i = 0; i < n; i++) dp[0][i] = 1;
  for (int i = 1; i < k + 1; i++)
    if (i <= inp[0])
      dp[i][0] = 1;
    else
      dp[i][0] = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 1; j < inp[i] + 1; j++)
      dp[j][i] =
          (dp[j][i - 1] % 1000000007 + dp[j - 1][i] % 1000000007) % 1000000007;
    x = 0;
    for (int j = inp[i] + 1; j < k + 1; j++) {
      dp[j][i] = ((dp[j][i - 1] % 1000000007 + dp[j - 1][i] % 1000000007) %
                      1000000007 -
                  dp[x++][i - 1] % 1000000007) %
                 1000000007;
      if (dp[j][i] < 0) dp[j][i] += 1000000007;
    }
  }
  for (int i = 0; i < k + 1; i++) {
    for (int j = 0; j < n; j++) cout << dp[i][j] << " ";
    cout << endl;
  }
  cout << (dp[k][n - 1]) % 1000000007 << endl;
  return 0;
}
