#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
long long FastPower(long long x, long long y) {
  if (!y) return 1;
  if (y & 1) return x * FastPower(x, y - 1) % Mod;
  return FastPower(x * x % Mod, y >> 1);
}
long long nCr(long long n, long long r) {
  if (r > n) return 0;
  long long up = 1, down = 1;
  for (int i = n - r + 1; i <= n; i++) up = up * i % Mod;
  for (int i = 1; i <= r; i++) down = down * i % Mod;
  return up * FastPower(down, Mod - 2) % Mod;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  vector<long long> vec(n);
  for (long long& x : vec) scanf("%lld", &x);
  vector<long long> preCalc(n);
  for (int i = 0; i < n; i++) preCalc[i] = nCr(k - 1 + i, i);
  for (int i = 0; i < n; i++) {
    long long cur = vec[i];
    for (int j = 0; j < i; j++)
      cur = (cur + vec[j] * preCalc[i - j] % Mod) % Mod;
    printf("%lld ", cur);
  }
  puts("");
  return 0;
}
