#include <bits/stdc++.h>
using namespace std;
const long long mod = (1e9 + 7);
long long n, k, v[2050], dp[2050], ans[2050];
long long poww(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 >>= 1;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i <= n; i++) {
    dp[i] = 1LL;
    for (int j = i + 1; j <= n; j++) {
      long long delta = j - i - 1;
      dp[j] = ((dp[j - 1]) * (k + delta)) % mod;
      dp[j] = (dp[j] * poww(delta + 1, mod - 2)) % mod;
      ans[j] = (ans[j] + dp[j] * v[i]) % mod;
    }
    ans[i] = (ans[i] + v[i]) % mod;
  }
  for (int i = 1; i <= n; i++) cout << (ans[i]) % mod << " \n"[i == n];
}
