#include <bits/stdc++.h>
using namespace std;
template <typename INT>
struct TripleDXY {
  INT d, x, y;
  TripleDXY(INT _d = 0, INT _x = 0, INT _y = 0) : d(_d), x(_x), y(_y) {}
};
template <typename INT>
TripleDXY<INT> egcd(INT a, INT b) {
  bool neg_a = a < 0;
  if (neg_a) a = -a;
  bool neg_b = b < 0;
  if (neg_b) b = -b;
  INT x = 0, lastx = 1;
  INT y = 1, lasty = 0;
  while (b != 0) {
    INT t = b;
    INT q = a / b;
    b = a % b;
    a = t;
    t = x;
    x = lastx - q * x;
    lastx = t;
    t = y;
    y = lasty - q * y;
    lasty = t;
  }
  return TripleDXY<INT>(a, neg_a ? -lastx : lastx, neg_b ? -lasty : lasty);
}
long long ChooseMod(int n, int k, int M) {
  long long res = 1;
  for (int i = 1; i <= k; ++i, --n) {
    TripleDXY<int> R = egcd(i, M);
    assert(R.d == 1);
    res = (res * n) % M;
    res = (res * R.x) % M;
    if (res < 0) res += M;
  }
  return res;
}
int N, K;
long long A[2004];
long long R[2004];
long long F[2004];
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> N >> K;
  F[0] = 1;
  for (int i = 1; i < N; ++i) {
    F[i] = ChooseMod(K - 1 + i, i, 1000000007);
  }
  for (int i = 0; i < N; ++i) cin >> A[i];
  R[0] = A[0] % 1000000007;
  for (int i = 1; i < N; ++i) {
    R[i] = 0;
    for (int j = 0; j <= i; ++j) {
      R[i] += (A[j] * F[i - j]);
      R[i] %= 1000000007;
    }
  }
  for (int i = 0; i < N; ++i) cout << R[i] << ' ';
  cout << endl;
  return 0;
}
