#include <bits/stdc++.h>
using namespace std;
long long inv[2005], c[2005], a[2005];
long long slove(int n, int m) {
  long long ans = 1;
  for (int i = 1; i <= m; i++)
    ans = ((ans * inv[i]) % 1000000007 * (n - i + 1)) % 1000000007;
  return ans;
}
int main() {
  int n, k;
  while (scanf("%d%d", &n, &k) != EOF) {
    for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
    if (k == 0) {
      for (int i = 0; i < n; i++) printf("%I64d ", a[i]);
      printf("\n");
      continue;
    }
    inv[0] = inv[1] = 1;
    for (int i = 2; i < 2005; i++)
      inv[i] =
          ((-1000000007 / i * inv[1000000007 % i]) % 1000000007 + 1000000007) %
          1000000007;
    for (int i = 0; i < n; i++) c[i] = slove(i + k - 1, i);
    for (int i = 0; i < n; i++) {
      long long ans = 0;
      for (int j = 0; j <= i; j++) ans = (ans + a[j] * c[i - j]) % 1000000007;
      printf("%I64d ", ans);
    }
    puts("");
  }
  return 0;
}
