#include <bits/stdc++.h>
const int mod = 1000000007;
using namespace std;
long long niyuan[2012];
long long exgcd(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1, y = 0;
    return a;
  }
  long long d = exgcd(b, a % b, x, y);
  long long t = x;
  x = y;
  y = t - a / b * y;
  return d;
}
int a[2012];
int main() {
  int i, j, k, t, N, K;
  long long x, y, res, sum;
  for (i = 1; i < 2012; ++i) {
    exgcd(i, mod, x, y);
    if (x < 0) x += mod;
    niyuan[i] = x;
  }
  while (scanf("%d %d", &N, &K) != EOF) {
    for (i = 1; i <= N; ++i) scanf("%d", &a[i]);
    if (K == 0) {
      for (i = 1; i <= N; ++i) {
        printf("%d", a[i]);
        if (i != N) printf(" ");
      }
      printf("\n");
      continue;
    }
    for (i = 1; i <= N; ++i) {
      res = 1;
      sum = 0;
      for (j = 1; j <= i; ++j) {
        sum += res * a[i - j + 1];
        sum %= mod;
        res *= (K + j - 1);
        res %= mod;
        res *= niyuan[j];
        res %= mod;
      }
      printf("%I64d", sum);
      if (i != N) printf(" ");
    }
    printf("\n");
  }
  return 0;
}
