#include <bits/stdc++.h>
using namespace std;
int read() {
  char x = getchar();
  int u = 0, fg = 0;
  while (!isdigit(x)) {
    if (x == '-') fg = 1;
    x = getchar();
  }
  while (isdigit(x)) {
    u = (u << 3) + (u << 1) + (x ^ 48);
    x = getchar();
  }
  return fg ? -u : u;
}
const int mod = 1e9 + 7;
int n, k;
long long a[2020], c[2020], inv[2020];
void init() {
  inv[1] = 1;
  for (register long long i = (2); i <= (n); ++i)
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
}
int main() {
  n = read();
  k = read() - 1;
  for (register long long i = (1); i <= (n); ++i) a[i] = read();
  if (k < 0) {
    for (register long long i = (1); i <= (n); ++i) printf("%lld ", a[i]);
    return 0;
  }
  init();
  c[0] = 1;
  for (register long long i = (1); i <= (n); ++i)
    c[i] = c[i - 1] * (k + i) % mod * inv[i] % mod;
  for (register long long i = (1); i <= (n); ++i) {
    long long ans = 0, x = i;
    for (register long long j = (0); j <= (i - 1); ++j) {
      ans = (ans + c[j] * a[x] % mod) % mod;
      x--;
    }
    printf("%lld ", ans);
  }
  return 0;
}
