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