#include <bits/stdc++.h>
using namespace std;
const int sz = 2010;
const long long mod = (long long)1e9 + 7;
long long _pow(long long a, long long n) {
  if (n == 0) return 1ll;
  a %= mod;
  long long tmp = _pow(a, n / 2);
  tmp = (tmp * tmp) % mod;
  if (n % 2 == 1ll) tmp = (a * tmp) % mod;
  while (tmp < 0) tmp += mod;
  return tmp;
}
long long inv(long long n) { return _pow(n, mod - 2); }
long long cnt[sz][sz] = {0};
long long dp[sz];
int main() {
  (mod);
  for (int i = 0, lets_stop_here = (int)sz; i < lets_stop_here; i++)
    cnt[i][0] = 1;
  for (int i = 1, lets_stop_here = (int)sz - 5; i <= lets_stop_here; i++)
    for (int j = 1, lets_stop_here = (int)sz - 5; j <= lets_stop_here; j++)
      cnt[i][j] = (cnt[i - 1][j] + cnt[i][j - 1]) % mod;
  int N;
  long long K;
  long long a[sz];
  cin >> N >> K;
  dp[0] = 1;
  for (int j = 1, lets_stop_here = (int)sz - 5; j <= lets_stop_here; j++) {
    dp[j] = (dp[j - 1] * (j + K - 1)) % mod;
    while (dp[j] < 0) dp[j] += mod;
    dp[j] = (dp[j] * inv(j)) % mod;
    while (dp[j] < 0) dp[j] += mod;
  }
  long long *mul = cnt[K];
  ("#3");
  for (int i = 0, lets_stop_here = (int)N; i < lets_stop_here; i++) cin >> a[i];
  for (int i = 0, lets_stop_here = (int)N; i < lets_stop_here; i++) {
    long long cur = 0;
    int k = 0;
    for (int k = 0, lets_stop_here = (int)i + 1; k < lets_stop_here; k++) {
      cur += (dp[k] * a[i - k]) % mod;
      cur %= mod;
    }
    cout << cur << " ";
  }
  cout << ("\n");
  return 0;
}
