#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long inf = 1e9 + 69;
const long double pi = 3.14159265358979323L;
const int N = 1e5 + 5;
void setIn(string s) { freopen(s.c_str(), "r", stdin); }
void setOut(string s) { freopen(s.c_str(), "w", stdout); }
void unsyncIO() { cin.tie(0)->sync_with_stdio(0); }
void setIO(string s = "") {
  unsyncIO();
  if (s.size()) {
    setIn(s + ".in");
    setOut(s + ".out");
  }
}
long long n, k, a[2005];
long long fact[2005], inv[2005], coef[2005], ans[2005];
long long pw(long long b, long long e) {
  long long rs = 1ll;
  for (; e > 0; e /= 2, b = (b * 1ll * b) % mod)
    if (e % 2 == 1) rs = (rs * b) % mod;
  return rs;
}
long long choose(long long a, long long b) {
  long long rs = 1ll;
  for (long long i = a - b + 1; i <= a; i++) rs = (rs * 1ll * i) % mod;
  rs = (rs * 1ll * inv[b]) % mod;
  return rs;
}
void init() {
  fact[0] = 1ll;
  for (int i = 1; i < 2005; i++) fact[i] = (fact[i - 1] * 1ll * i) % mod;
  inv[2004] = pw(fact[2004], mod - 2);
  for (int i = 2003; i >= 0; i--) inv[i] = (inv[i + 1] * 1ll * (i + 1)) % mod;
  for (int i = 1; i < 2005; i++) coef[i] = choose(i + k - 1, i - 1);
}
int main() {
  setIO();
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (k == 0) {
    for (int i = 0; i < n; i++) cout << a[i] << ' ';
    cout << "\n";
    return 0;
  }
  k--;
  init();
  for (int i = 0; i < n; i++) {
    ans[i] = 0ll;
    for (int j = i; j >= 0; j--)
      ans[i] = (ans[i] + (coef[i + 1 - j] * 1ll * a[j]) % mod) % mod;
  }
  for (int i = 0; i < n; i++) cout << ans[i] << ' ';
  cout << "\n";
  return 0;
}
