#include <bits/stdc++.h>
const int N = 2005, mo = (int)1e9 + 7;
int n, k, a[N], c[N], inv[N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  inv[1] = 1;
  for (int i = 2; i <= n; i++) inv[i] = 1LL * (mo - mo / i) * inv[mo % i] % mo;
  for (int i = 0; i < n; i++) {
    c[i] = 1;
    for (int j = 1; j <= i; j++) c[i] = 1LL * c[i] * (k + i - j) % mo;
    for (int j = 1; j <= i; j++) c[i] = 1LL * c[i] * inv[j] % mo;
  }
  for (int i = 1; i <= n; i++) {
    int ans = 0;
    for (int j = 1; j <= i; j++) ans = (ans + 1LL * a[j] * c[i - j]) % mo;
    printf("%d ", ans);
  }
}
