#include <bits/stdc++.h>
template <typename T>
T inline SQR(const T& a) {
  return a * a;
}
template <typename T>
T inline ABS(const T& a) {
  return a < 0 ? -a : a;
}
const double EPS = 1e-9;
inline int SGN(double a) {
  return ((a > EPS) ? (1) : ((a < -EPS) ? (-1) : (0)));
}
inline int CMP(double a, double b) { return SGN(a - b); }
using namespace std;
const long long mod = 1000000007LL;
long long a[2222];
long long mlt[2222];
long long extended_gcd(long long* a, long long b) {
  long long x = 0ll, lastx = 1ll;
  long long y = 1ll, lasty = 0ll;
  long long temp, quot, rem;
  while (b) {
    quot = (*a) / b;
    rem = (*a) % b;
    *a = b;
    b = rem;
    temp = x;
    x = lastx - quot * x;
    lastx = temp;
    temp = y;
    y = lasty - quot * y;
    lasty = temp;
  }
  return lastx;
}
long long inverse(long long a, long long m) {
  long long x = extended_gcd(&a, m);
  return ((x + m) % m);
}
int main(int argc, char* argv[]) {
  ios::sync_with_stdio(false);
  int N, k;
  cin >> N >> k;
  for (int i = 0; i < N; ++i) cin >> a[i];
  for (int i = 0; i < N; ++i)
    if (a[i] >= mod) a[i] %= mod;
  if (k == 0) {
    for (int i = 0; i < N; ++i) {
      if (i) cout << " ";
      cout << a[i];
    }
    cout << "\n";
    return 0;
  }
  mlt[0] = 1LL;
  mlt[1] = k % mod;
  long long num = k;
  long long den = 1;
  for (int i = 2; i <= N - 1; ++i) {
    num++;
    den++;
    mlt[i] = (((mlt[i - 1] * num) % mod) * inverse(den, mod)) % mod;
  }
  for (int i = 0; i < N; ++i) {
    long long s = 0;
    if (i) cout << " ";
    for (int j = 0; j < i + 1; ++j) {
      s += (mlt[j] * a[i - j]) % mod;
      if (s >= mod) s -= mod;
    }
    cout << s;
  }
  cout << "\n";
  return 0;
}
