#include <bits/stdc++.h>
const double eps = 1e-5;
const int inf = 1000000000;
const long long mod = 1000000007;
using namespace std;
int n, k;
long long dat[2020];
long long xishu[2020];
long long ans[2020];
long long niyuan(long long a, long long b, long long c) {
  if (c == 1) return 0;
  if (c <= 0) return -1;
  a %= c;
  long long res = 1;
  while (b) {
    if (b & 1) {
      res = res * a % c;
    }
    a = a * a % c;
    b >>= 1;
  }
  return res;
}
long long C(int n, int m) {
  long long ans = 1;
  for (int i = n; i >= n - m + 1; i--) {
    ans = (ans * i + mod) % mod;
  }
  for (int i = 1; i <= m; i++) {
    ans = (ans * niyuan(i, mod - 2, mod) + mod) % mod;
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%I64d", &dat[i]);
  if (k == 0) {
    for (int i = 1; i <= n; i++) cout << dat[i] << " ";
    cout << endl;
    return 0;
  }
  memset(xishu, 0, sizeof(xishu));
  xishu[1] = 1;
  for (int i = 2; i <= n; i++) {
    xishu[i] = C(k + i - 2, i - 1);
  }
  memset(ans, 0, sizeof(ans));
  for (int i = 1; i <= n; i++) {
    for (int j = i; j > 0; j--) {
      ans[i] = (ans[i] + dat[j] * xishu[i - j + 1] + mod) % mod;
    }
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
}
