#include <bits/stdc++.h>
using namespace std;
const int Maxn = 2000 + 10, Mod = 1000 * 1000 * 1000 + 7;
long long n, k, arr[Maxn], fact[Maxn], f[Maxn], zrb[Maxn];
long long pw(int a, int b) {
  long long ans = 1;
  for (int i = 31; i >= 0; i--) {
    ans *= ans, ans %= Mod;
    if ((b >> i) & 1) ans *= (long long)a, ans %= Mod;
  }
  return ans;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  fact[0] = 1;
  for (int i = 1; i < n; i++) fact[i] = (fact[i - 1] * (long long)i) % Mod;
  f[0] = k;
  for (int i = 1; i < n; i++) f[i] = (f[i - 1] * (long long)(k + i)) % Mod;
  zrb[0] = 1;
  for (int i = 1; i < n; i++)
    zrb[i] = (f[i - 1] * (long long)pw(fact[i], Mod - 2)) % Mod;
  for (int i = 0; i < n; i++) {
    long long ans = 0;
    for (int j = i; j >= 0; j--) ans += (arr[j] * zrb[i - j]) % Mod, ans %= Mod;
    cout << ans << " ";
  }
  cout << endl;
  return 0;
}
