#include <bits/stdc++.h>
using namespace std;
long long inv(long long i, long long m) {
  for (long j = 0;; j++)
    if ((m * j + 1) % i == 0) return (m * j + 1) / i;
}
int main() {
  long long n, k;
  long long m = 1000000007;
  cin >> n >> k;
  long long* arr = new long long[n];
  long long* coeff = new long long[n];
  long long l = 1;
  cin >> arr[0];
  coeff[0] = 1;
  for (long long i = 1; i < n; i++) {
    cin >> arr[i];
    coeff[i] = (coeff[i - 1] * (k + l - 1));
    coeff[i] %= m;
    coeff[i] *= inv(l, m);
    coeff[i] %= m;
    ++l;
  }
  if (k == 0) {
    for (long long i = 0; i < n; i++) {
      cout << arr[i] << " ";
    }
    return 0;
  }
  for (long long i = 0; i < n; i++) {
    long long res = arr[i];
    long long id = 1;
    for (long long j = i - 1; j >= 0; j--) {
      long long add = (coeff[id++] * arr[j]) % m;
      res = (res + add) % m;
    }
    cout << res << " ";
  }
  return 0;
}
