#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2010, M = 1000000007;
int n, k;
int a[MAXN];
long long b[MAXN];
long long expn(int x, int e) {
  if (e == 0) return 1;
  if (e & 1) {
    long long q = expn(x, (e - 1) / 2);
    q = (q * q) % M;
    return (x * q) % M;
  } else {
    long long q = expn(x, e / 2);
    return (q * q) % M;
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  b[0] = 1;
  for (int i = 1; i < n; i++) {
    long long f = expn(i, M - 2);
    f = (((k + i - 1) % M) * f) % M;
    f = (b[i - 1] * f) % M;
    b[i] = f;
  }
  for (int i = 0; i < n; i++) {
    int s = 0;
    for (int j = 0; j <= i; j++) {
      int q = (a[j] * b[i - j]) % M;
      s = (s + q) % M;
    }
    cout << s << " ";
  }
  cout << endl;
  return 0;
}
