#include <bits/stdc++.h>
int mo = 1e9 + 7;
using namespace std;
int main(int argc, char const *argv[]) {
  int n, k;
  scanf("%d%d", &n, &k);
  int a[n];
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  long long dp[n + 1][k + 1];
  long long sumarr[n + 1][k + 1];
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i <= k; ++i) {
    dp[0][i] = 0;
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 0; j <= k; ++j) {
      if (j == 0) {
        sumarr[i - 1][j] = dp[i - 1][j] % mo;
      } else {
        sumarr[i - 1][j] = ((sumarr[i - 1][j - 1]) + (dp[i - 1][j])) % mo;
      }
    }
    for (int j = 0; j <= k; ++j) {
      int t = min(j, a[i - 1]);
      if (t == j) {
        dp[i][j] = sumarr[i - 1][j];
      } else {
        dp[i][j] = sumarr[i - 1][j] - sumarr[i - 1][j - t - 1];
      }
    }
  }
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= k; ++j) {
      printf("%lld ", dp[i][j]);
    }
    printf("\n");
  }
}
