#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int inf = 1e7;
template <typename T>
T maxi(T x, T y) {
  return (x > y) ? x : y;
}
template <typename T>
T mini(T x, T y) {
  return (x < y) ? x : y;
}
long long modExpo(long long a, long long b, long long c) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return modExpo(((a % c) * (a % c)) % c, b / 2, c) % c;
  else
    return ((a % c) * (modExpo(((a % c) * (a % c)) % c, b / 2, c) % c)) % c;
}
int n;
long long k;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  long long arr[n];
  for (int i = (0); i < (n); i++) cin >> arr[i];
  if (k == 0) {
    for (int i = (0); i < (n); i++) cout << arr[i] << " ";
    exit(0);
  }
  long long ans[n];
  vector<int> adj[n + 10];
  long long denom = 1, prev = k, last = 1;
  for (int i = (1); i < (n); i++) {
    long long n1 = ((prev % mod) * (last % mod)) % mod;
    denom = ((denom % mod) * (i % mod)) % mod;
    long long inv = modExpo(denom, mod - 2, mod) % mod;
    long long num = ((n1 % mod) * (inv % mod)) % mod;
    ++prev;
    last = n1;
    adj[i].push_back(num);
  }
  memset(ans, 0, sizeof(ans));
  ans[0] = arr[0];
  adj[1].push_back(1);
  for (int i = (1); i < (n); i++) {
    int cnt = 0;
    for (auto u : adj[i]) {
      adj[i + 1].push_back(u);
      long long temp = ((u % mod) * (arr[cnt] % mod)) % mod;
      ans[i] = ((ans[i] % mod) + (temp % mod)) % mod;
      ++cnt;
    }
  }
  for (int i = (0); i < (n); i++) cout << ans[i] << " ";
  return 0;
}
