#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000 + 7;
const double EPS = 1e-9;
template <class T>
void chmin(T &t, T f) {
  if (t > f) t = f;
}
template <class T>
void chmax(T &t, T f) {
  if (t < f) t = f;
}
inline int getint() {
  int a;
  return scanf("%d", &a) ? a : (fprintf(stderr, "trying to read\n"), -1);
}
inline double getdouble() {
  double a;
  return scanf("%lf", &a) ? a : (fprintf(stderr, "trying to read\n"), -1.0);
}
long long apowbmodc(int a, int b, int c) {
  if (b == 0) return 1;
  long long ret = apowbmodc(a, b / 2, c);
  ret *= ret;
  ret %= c;
  if (b & 1) ret *= a;
  ret %= c;
  return ret;
}
long long inv(int n) { return apowbmodc(n, INF - 2, INF); }
long long nCk(int n, int k) {
  long long ret = 1;
  for (int i = (int)0; i < (int)k; ++i) {
    ret *= n - i;
    ret %= INF;
  }
  for (int i = (int)0; i < (int)k; ++i) {
    ret *= inv(i + 1);
    ret %= INF;
  }
  return ret;
}
void myCode() {
  int n = getint(), k = getint();
  vector<long long> a(n);
  for (int i = (int)0; i < (int)n; ++i) cin >> a[i];
  vector<long long> choose(n);
  for (int i = (int)0; i < (int)n; ++i) choose[i] = nCk(k - 1 + i, i);
  for (int i = (int)0; i < (int)n; ++i) {
    long long ret = 0;
    for (int j = (int)0; j < (int)i + 1; ++j) {
      ret += choose[j] * a[i - j];
      ret %= INF;
    }
    printf("%I64d%c", ret, i == n - 1 ? '\n' : ' ');
  }
}
int main() {
  srand(time(NULL));
  myCode();
  return 0;
}
