#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int ret = 0, f = 1;
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') ret = ret * 10 + ch - '0', ch = getchar();
  return ret * f;
}
const int mx = 5005;
const long long mod = 1e9 + 7;
int n, m;
long long c[mx];
inline void mul(int *a, int *b) {
  memset(c, 0, sizeof(c));
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= i; j++) c[i] += (1ll * a[i - j + 1] * b[j] % mod);
  for (int i = 1; i <= n; i++) a[i] = c[i] % mod;
}
int a[mx], b[mx];
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) a[i] = read(), b[i] = 1;
  for (; m; m >>= 1, mul(b, b))
    if (m & 1) mul(a, b);
  for (int i = 1; i <= n; i++) printf("%d\n", a[i]);
  return 0;
}
