#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2005;
const long long p = 1e9 + 7;
long long s[maxn], a[maxn], n, k;
long long c[maxn], inv[maxn];
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
inline void init() {
  inv[0] = inv[1] = 1;
  for (long long i = 2; i <= n; i++) inv[i] = (p - p / i) * inv[p % i] % p;
  c[0] = 1;
  for (long long i = 1; i <= n; i++)
    c[i] = c[i - 1] * inv[i] % p * (i + k - 1) % p;
}
signed main() {
  n = read(), k = read();
  for (long long i = 1; i <= n; i++) a[i] = read();
  if (!k) {
    for (long long i = 1; i <= n; i++) printf("%lld ", a[i]);
    return 0;
  }
  init();
  for (long long j = 1; j <= n; j++)
    for (long long i = 1; i <= j; i++)
      s[j] = (s[j] + a[i] % p * c[j - i] % p) % p;
  for (long long i = 1; i <= n; i++) printf("%lld ", s[i]);
  return 0;
}
