#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 50;
const int maxm = 1e6 + 50;
const double eps = 1e-10;
const int max_index = 62;
const int inf = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
inline int read() {
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  int x = 0;
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x;
}
long long a[maxn];
long long C[maxn];
long long ans[maxn];
void exgcd(long long a, long long b, long long& d, long long& x, long long& y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    exgcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long inv(long long a) {
  long long d, x, y;
  if (a == 0) return MOD;
  exgcd(a, MOD, d, x, y);
  return (x + MOD) % MOD;
}
int main() {
  int n = read(), k = read();
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    long long up = 1, down = 1;
    for (int j = 0; j < i; j++) {
      up = up * (k + i - 1 - j) % MOD;
      down = down * (j + 1) % MOD;
    }
    C[i] = up * inv(down) % MOD;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      ans[j] = (ans[j] + a[i] * C[j - i] % MOD) % MOD;
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << " ";
  return 0;
}
