#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int maxn = 2010;
int a[maxn], inv[maxn], C[maxn];
void exgcd(int a, int b, int &d, int &x, int &y) {
  if (!b) {
    d = a, x = 1, y = 0;
  } else {
    exgcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
int main() {
  int n, k;
  int d, y;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  inv[0] = 1;
  for (int i = 1; i < n; i++) {
    exgcd(i, MOD, d, inv[i], y);
    inv[i] = (inv[i] % MOD + MOD) % MOD;
  }
  C[0] = 1;
  for (int i = 1; i < n; i++) {
    C[i] = (long long)C[i - 1] * (k + i - 1) % MOD * inv[i] % MOD;
  }
  for (int i = 0; i < n; i++) {
    int v = 0;
    for (int j = 0, k = i; j <= i; j++, k--) {
      v = ((long long)v + (long long)a[k] * C[j] % MOD) % MOD;
    }
    printf("%d%c", v, i == n - 1 ? '\n' : ' ');
  }
  return 0;
}
