#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 9;
const int mod = 1e9 + 7;
const long long MOD = 1e9 + 696969;
const long long INF = 1e18;
long long silnia[4010], INV[4010];
long long tab[4010];
int n, k;
inline long long potmod(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b /= 2;
  }
  return res;
}
inline long long getBinom(int n, int k) {
  if (k == 0 || n == k || n < k) return 1;
  long long ilo = 1;
  for (int i = (1); i <= (k); ++i) ilo = (ilo * (n - i + 1)) % mod;
  return (ilo * INV[k]) % mod;
}
long long dp[4010], coef[4010];
int main() {
  silnia[0] = 1;
  for (int i = (1); i <= (4010 - 1); ++i) silnia[i] = (silnia[i - 1] * i) % mod;
  for (int i = (1); i <= (4010 - 1); ++i)
    INV[i] = potmod(silnia[i], mod - 2) % mod;
  cin >> n >> k;
  for (int i = (1); i <= (n); ++i) cin >> tab[i];
  if (k == 0) {
    for (int i = (1); i <= (n); ++i) cout << tab[i] << ' ';
    exit(0);
  }
  for (int i = n; i > 0; --i) coef[i] = getBinom(k + i - 2, i - 1);
  for (int s = (1); s <= (n); ++s) {
    for (int i = (s); i <= (n); ++i)
      dp[i] += tab[s] * coef[i - s + 1], dp[i] %= mod;
  }
  for (int i = (1); i <= (n); ++i) cout << dp[i] << ' ';
}
