#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e12;
long long MOD = 1000000007;
const long long N = 2e3 + 10;
long long n, k, a[N], coeff[N], inv[N], ans[N] = {0};
long long power(long long a, long long b) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2) {
      x = (x * y) % MOD;
    }
    y = (y * y) % MOD;
    b /= 2;
  }
  return x % MOD;
}
void filler() {
  for (long long i = 1; i < N; i++) {
    inv[i] = power(i, MOD - 2);
  }
}
void solve() {
  cin >> n >> k;
  filler();
  k--;
  for (long long i = 0; i < n; i++) cin >> a[i];
  coeff[0] = 1;
  coeff[1] = k + 1;
  coeff[1] %= MOD;
  coeff[1] += MOD;
  coeff[1] %= MOD;
  for (long long i = 2; i < n; i++) {
    coeff[i] = coeff[i - 1] * (k + i);
    coeff[i] %= MOD;
    coeff[i] += MOD;
    coeff[i] %= MOD;
    coeff[i] *= inv[i];
    coeff[i] %= MOD;
    coeff[i] += MOD;
    coeff[i] %= MOD;
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = i; j < n; j++) {
      ans[j] += a[i] * coeff[j - i];
      ans[j] %= MOD;
      ans[j] += MOD;
      ans[j] %= MOD;
    }
  }
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
}
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
}
