#include <bits/stdc++.h>
using namespace std;
int in() {
  char c;
  bool g = false;
  while (c = getchar(), c < '0' || c > '9')
    if (c == '-')
      g = true;
    else
      g = false;
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return g ? -x : x;
}
void out(int x) {
  int len = 0, data[20];
  while (x) {
    data[len++] = x % 10;
    x /= 10;
  }
  if (!len) data[len++] = 0;
  if (data[0] != abs(data[0])) putchar('-');
  while (len--) putchar(abs(data[len]) + 48);
  putchar(' ');
}
void out(string s) {
  int len = 0;
  while (len++ < s.size()) putchar(s[len - 1]);
  putchar('\n');
}
const long long N = 2020, MOD = 1e9 + 7;
long long a[N], b[N], ans[N];
long long pw(long long a, long long b) {
  return b ? (pw((a * a) % MOD, b / 2) * (b % 2 ? a : 1)) % MOD : 1;
}
int main() {
  int n = in(), k = in();
  for (int i = 0; i < n; i++) a[i] = in();
  if (!k) {
    for (int i = 0; i < n; i++) out(a[i]);
    out("");
    return 0;
  }
  b[0] = 1;
  for (int i = 0; i < n; i++, b[i] = 1)
    for (int j = 1; j <= i; j++)
      b[i] = (b[i] * (k + j - 1)) % MOD, b[i] = (b[i] * pw(j, MOD - 2)) % MOD;
  for (int i = 0; i < n; i++, ans[i] = 0)
    for (int j = 0; j <= i; j++) ans[i] = (ans[i] + a[j] * b[i - j]) % MOD;
  for (int i = 0; i < n; i++) out(ans[i]);
  out("");
  return 0;
}
