#include <bits/stdc++.h>
using namespace std;
const long long modulo = 1000000007;
long long rev(long long elem) {
  long long power = modulo - 2;
  long long res = 1;
  while (power > 0) {
    if (power & 1) res = (res * elem) % modulo;
    elem = (elem * elem) % modulo;
    power >>= 1;
  }
  return res;
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<long long> a(n), res(n, 0), coef(n, 1);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long cur = 1;
  res[0] = a[0];
  cout << res[0] << ' ';
  for (int i = 1; i < n; i++) {
    cur = (cur * (i + k - 1)) % modulo;
    cur = (cur * rev(i)) % modulo;
    coef[i] = cur;
    for (int j = 0; j <= i; j++) {
      res[i] += (a[j] * coef[i - j]);
      res[i] %= modulo;
    }
    cout << res[i] << ' ';
  }
  return 0;
}
