#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000;
const long long INF64 = ((long long)INF) * INF;
const double PI = acos(-1.0);
template <typename T>
inline T sqr(T x) {
  return x * x;
}
const int MOD = INF + 7;
struct matrix {
  int n;
  vector<int> val;
  int get(int i, int j) const {
    if (j < i) return 0;
    return val[j - i];
  }
};
void mul(const matrix& a, const matrix& b, matrix& c) {
  int n = a.n;
  for (int i = 0; i < n; ++i) c.val[i] = 0;
  for (int j = 0; j < n; ++j) {
    long long temp = 0;
    for (int k = 0; k < n; ++k) {
      temp += ((long long)a.get(0, k)) * b.get(k, j);
      if (temp >= MOD) temp %= MOD;
    }
    c.val[j] = temp;
  }
}
int n, k;
matrix a, b, c, d;
vector<int> ar, res;
void f(const matrix& a, matrix& b) {
  for (int i = 0; i < n; ++i) b.val[i] = a.val[i];
}
matrix pow(const matrix& a, int p) {
  b = a;
  for (int i = 1; i < n; ++i) c.val[i] = 0;
  c.val[0] = 1;
  while (p > 0) {
    if (p & 1) {
      f(c, d);
      mul(d, b, c);
    }
    p = (p >> 1);
    f(b, d);
    mul(d, d, b);
  }
  return c;
}
void solve() {
  if (k > 0) {
    a = pow(a, k);
    for (int i = 0; i < n; ++i) {
      long long temp = 0;
      for (int j = 0; j <= i; ++j) {
        temp += ((long long)ar[j]) * a.get(j, i);
        if (temp >= MOD) temp %= MOD;
      }
      cout << temp << " ";
    }
  } else {
    for (int i = 0; i < n; ++i) cout << ar[i] << " ";
  }
}
int main() {
  cin >> n >> k;
  a.n = n;
  a.val.assign(n, 1);
  b.n = n;
  b.val.resize(n);
  c.n = n;
  c.val.resize(n);
  d.n = n;
  d.val.resize(n);
  ar.resize(n);
  for (int i = 0; i < n; ++i) cin >> ar[i];
  solve();
  return 0;
}
