#include <bits/stdc++.h>
using namespace std;
const int N = 2000;
const int mod = 1e9 + 7;
int a[N], c[N];
int binPow(int a, int k) {
  int res = 1;
  while (k) {
    if (k & 1) res = (1ll * res * a) % mod;
    a = (1ll * a * a) % mod;
    k >>= 1;
  }
  return res;
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  c[0] = 1;
  for (int i = 1; i < n; i++)
    c[i] = (((1ll * c[i - 1] * (k + i - 1)) % mod) * binPow(i, mod - 2)) % mod;
  for (int i = 0; i < n; i++) {
    int res = 0;
    for (int j = 0; j <= i; j++)
      res = (res + (1ll * c[i - j] * a[j]) % mod) % mod;
    cout << res << ' ';
  }
  cout << endl;
  return 0;
}
