#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int N = 2000;
int n;
inline int times(int a, int b) { return (int)(((long long int)a * b) % mod); }
void conv(int a[N], int b[N], int c[N]) {
  for (int k = 0; k < n; k++) {
    c[k] = 0;
    for (int i = 0; i <= k; i++) {
      c[k] += times(a[i], b[k - i]);
      c[k] %= mod;
    }
  }
}
void mult(int a[N], int x[N], int res[N]) {
  for (int j = 0; j < n; j++) {
    res[j] = 0;
    for (int i = 0; j + i < n; i++) {
      res[j] += times(a[i], x[j + i]);
      res[j] %= mod;
    }
  }
}
void exp_mat(int a[N], int exp, int res[N]) {
  if (exp == 0) {
    for (int i = 0; i < n; i++) res[i] = 0;
    res[0] = 1 % mod;
  } else {
    int tmp[N];
    int halfsq[N];
    exp_mat(a, exp / 2, tmp);
    conv(tmp, tmp, halfsq);
    if (exp % 2 == 0) {
      for (int i = 0; i < n; i++) tmp[i] = 0;
      tmp[0] = 1 % mod;
    } else {
      for (int i = 0; i < n; i++) tmp[i] = a[i];
    }
    conv(tmp, halfsq, res);
  }
}
int main() {
  int k;
  int x[N];
  scanf("%d", &n);
  scanf("%d", &k);
  for (int i = 0; i < n; i++) scanf("%d", &x[i]);
  reverse(x, x + n);
  int a[N];
  int exxp[N];
  int res[N];
  for (int i = 0; i < n; i++) a[i] = 1;
  exp_mat(a, k, exxp);
  mult(exxp, x, res);
  reverse(res, res + n);
  for (int i = 0; i < n; i++) printf("%d ", res[i]);
  printf("\n");
  return 0;
}
