#include <bits/stdc++.h>
using namespace std;
const long long N = 2e3 + 5, inf = 1e9 + 7, hell = inf;
long long n, k, i, j;
long long A[N], B[N];
inline long long expo(long long n, long long k, long long p = inf) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long i, j, a, b, ans = 0;
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> A[i];
  vector<long long> v(n, 1);
  for (i = 1; i < n; i++)
    v[i] = v[i - 1] * (k + i - 1) % inf * expo(i, inf - 2) % inf;
  for (i = 0; i < n; i++)
    for (j = 0; j < i + 1; j++) B[i] += v[j] * A[i - j] % inf;
  for (i = 0; i < n; i++) cout << B[i] % inf << " ";
}
