#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "unroll-loops")
using namespace std;
long long n, m, a[101], dp[101][100001];
const long long MOD = 1e9 + 7;
int main() {
  cin >> n >> m, dp[0][0] = 1;
  for (int i = 1; i <= n; i++) cin >> a[i], dp[i][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      dp[i][j] = (dp[i][j - 1] + dp[i - 1][j]) % MOD;
      if (j - a[i] > 0)
        dp[i][j] = ((dp[i][j] - dp[i - 1][j - a[i] - 1]) % MOD + MOD) % MOD;
    }
  }
  for (int i = 1; i <= n; cout << '\n', i++)
    for (int j = 1; j <= m; j++) cout << (dp[i][j]) % MOD << ' ';
  cout << dp[n][m] << '\n';
}
