#include <bits/stdc++.h>
using namespace std;
long long modpow(int a, int n) {
  long long r = 1;
  for (long long x = a; n; n >>= 1, x = (x * x) % 1000000007)
    if (n & 1) r = (r * x) % 1000000007;
  return r;
}
int inv(int a) { return modpow(a, 1000000007 - 2); }
long long binomialCoeff(int n, int r) {
  if (n < r) return 0;
  if (n - r < r) r = n - r;
  long long res = 1;
  for (int i = r; i > 0; --i) {
    res = (res * ((n - i + 1) % 1000000007)) % 1000000007;
    res = (res * inv(i)) % 1000000007;
  }
  return res;
}
long long arr[2005];
int N, K;
int main() {
  cin >> N;
  cin >> K;
  for (int i = 0; i < (N); i++) {
    cin >> arr[i];
    if (K == 0) cout << arr[i] << " ";
  }
  if (K == 0) {
    cout << endl;
    return 0;
  }
  vector<long long> Cs;
  for (int i = 0; i < N; i++) {
    Cs.push_back(binomialCoeff(K - 1 + i, i));
    long long res = 0;
    int x = 0;
    for (int j = Cs.size() - 1; j >= 0; j--) {
      res += Cs[j] * arr[x];
      res %= 1000000007;
      x++;
    }
    cout << res << " ";
  }
  cout << endl;
  return 0;
}
