#include <bits/stdc++.h>
using namespace std;
const long long d = 1000000007;
int n, k, a[2222];
long long pd(long long a, long long b) {
  long long c = 1;
  while (b) {
    if (b & 1) c = (c * a) % d;
    a = (a * a) % d;
    b >>= 1;
  }
  return c;
}
long long fc[2222], ifc[2222], ic[2222];
int main() {
  fc[0] = 1;
  ifc[0] = 1;
  ic[0] = 0;
  for (int i = (1); i <= (2100); ++i) {
    fc[i] = fc[i - 1] * i % d;
    ifc[i] = pd(fc[i], d - 2);
    ic[i] = pd(i, d - 2);
  }
  scanf("%d%d", &n, &k);
  for (int i = (1); i <= (n); ++i) scanf("%d", a + i);
  if (!k) {
    for (int i = (1); i <= (n); ++i) printf("%d%s", a[i], i == n ? "\n" : " ");
    return 0;
  }
  --k;
  for (int p = (1); p <= (n); ++p) {
    int ans = 0;
    long long t = 1;
    for (int i = (p); i >= (1); --i) {
      (ans += a[i] * t % d) %= d;
      (t *= ic[p - i + 1]) %= d;
      (t *= p - (i - 1) + k) %= d;
    }
    printf("%d%s", ans, p == n ? "\n" : " ");
  }
  return 0;
}
