#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 7;
const int MOD = 1e9 + 7;
int n, k, a[N], r[N], rf[N];
void inc(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
long long kpow(long long a, long long b) {
  long long r = 1;
  while (b > 0) {
    if (b & 1) r = r * a % MOD;
    a = a * a % MOD, b >>= 1;
  }
  return r;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = (0); i < (n + 1); ++i) rf[i] = kpow(i, MOD - 2);
  for (int i = (0); i < (n); ++i) scanf("%d", &a[i]);
  for (int i = (0); i < (n); ++i) {
    int c = a[i];
    for (int d = (0); d < (n - i); ++d) {
      inc(r[i + d], c);
      c = 1ll * c * (k + d) % MOD * rf[d + 1] % MOD;
    }
  }
  for (int i = (0); i < (n); ++i) {
    if (i) putchar(' ');
    printf("%d", r[i]);
  }
  return 0;
}
