#include <bits/stdc++.h>
using namespace std;
long long N, K, a[2005], h[2005], b[2005], temp[2005];
void mul(long long *a, long long *b) {
  int i, j;
  memset(temp, 0, sizeof(temp));
  for (i = 1; i <= N; i++)
    for (j = 1; j <= i; j++)
      temp[i] = (temp[i] + a[j] * b[i - j + 1]) % 1000000007;
  for (i = 1; i <= N; i++) a[i] = temp[i];
}
void getmtrix() {
  int i;
  for (i = 1; i <= N; i++) h[i] = 1;
  memset(b, 0, sizeof(b));
  b[1] = 1;
  for (i = 0; i < 30; i++) {
    if (K & (1 << i)) mul(b, h);
    mul(h, h);
  }
  return;
}
int main() {
  int i, j;
  while (~scanf("%d%d", &N, &K)) {
    for (i = 1; i <= N; i++) scanf("%I64d", &a[i]);
    getmtrix();
    for (i = 1; i <= N; i++) {
      long long x = 0;
      for (j = 1; j <= i; j++) x = (x + a[i - j + 1] * b[j]) % 1000000007;
      printf("%I64d ", x);
    }
    printf("\n");
  }
  return 0;
}
