#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n, k;
long long d[2001], D[2001], r[2001];
int C[1000][1000];
void Comb(int n, int m = 0) {
  for (int i = 0; i <= n; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
      if (C[i][j] >= m) C[i][j] -= m;
    }
  }
}
long long ModExp(long long a, long long n, long long mod) {
  long long r = 1, t = a;
  while (n) {
    if (n & 1) r = (r * t) % mod;
    t = (t * t) % mod;
    n >>= 1;
  }
  return r;
}
template <class T>
inline T Inv(T a, T n = mod) {
  return ModExp(a, n - 2, n);
}
void getD() {
  k--;
  D[0] = 1;
  for (int i = 1; i < n; i++) {
    D[i] = D[i - 1] * (k + i) % mod * Inv(i) % mod;
  }
  r[0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= i; j++) {
      r[i] = (r[i] + D[i - j] * d[j]) % mod;
    }
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> d[i];
  if (k == 0)
    memcpy(r, d, sizeof(d));
  else
    getD();
  copy(r, r + n, ostream_iterator<int>(cout, " "));
  return 0;
}
