#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmax(T &x, T y) {
  if (x < y) x = y;
}
template <class T>
inline void checkmin(T &x, T y) {
  if (x > y) x = y;
}
template <class T>
inline T Min(T x, T y) {
  return (x > y ? y : x);
}
template <class T>
inline T Max(T x, T y) {
  return (x < y ? y : x);
}
template <class T>
T Abs(T a) {
  return a > 0 ? a : (-a);
}
template <class T>
inline T lowbit(T n) {
  return (n ^ (n - 1)) & n;
}
template <class T>
inline int countbit(T n) {
  return (n == 0) ? 0 : (1 + countbit(n & (n - 1)));
}
long long Pow(long long x, long long y) {
  if (!y) return 1;
  long long res = Pow(x * x % 1000000007, y / 2);
  if (y & 1) res = res * x % 1000000007;
  return res;
}
long long n, k;
long long a[2222], res;
long long num[2222];
int main() {
  while (scanf("%I64d%I64d", &n, &k) == 2) {
    for (int i = 1; i <= (int)(n); ++i) scanf("%I64d", a + i);
    num[1] = 1;
    if (k == 0) {
      for (int i = 1; i <= (int)(n - 1); ++i) printf("%I64d ", a[i]);
      printf("%I64d\n", a[n]);
      continue;
    }
    for (int i = 2; i <= (int)(n); ++i)
      num[i] = (num[i - 1] * (i + k - 2)) % 1000000007 *
               Pow(i - 1, 1000000007 - 2) % 1000000007;
    for (int i = 1; i <= (int)(n); ++i) {
      if (i != 1) putchar(' ');
      res = 0;
      for (int j = 1; j <= (int)(i); ++j)
        res = (res + a[j] * num[i - j + 1]) % 1000000007;
      printf("%I64d", res);
    }
    puts("");
  }
  return 0;
}
