#include <bits/stdc++.h>
using namespace std;
int n, k;
const int MAXN = 100000 + 100;
const int mod = 1000000007;
long long a[MAXN];
long long dp[110][MAXN];
long long qzh[110][MAXN];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  for (register int i = 1; i <= n; i++) cin >> a[i];
  dp[0][0] = 1;
  for (register int i = 0; i <= n; i++) {
    for (register int j = 0; j <= k; j++) {
      if (i > 0)
        dp[i][j] += qzh[i - 1][j];
      else
        dp[i][j] += qzh[i][j];
      dp[i][j] %= mod;
      if (j > 0)
        qzh[i][j] = qzh[i][j - 1] + dp[i][j];
      else
        qzh[i][j] += dp[i][j];
      qzh[i][j] %= mod;
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= k; j++) {
      cout << dp[i][j] << ' ';
    }
    cout << endl;
  }
  cout << dp[n][k];
  return 0;
}
