#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
long long valu[N], res[N], C[N];
void ex_gcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return;
  }
  ex_gcd(b, a % b, x, y);
  long long tmp = y;
  y = x - a / b * y;
  x = tmp;
}
long long getC(long long k, long long n) {
  long long res = 1, x, y;
  for (int i = 1; i <= k; i++) {
    res = (res * (n - k + i)) % mod;
    ex_gcd(i, mod, x, y);
    x = (x + mod) % mod;
    res = (res * x) % mod;
  }
  return res;
}
int main() {
  int n, k;
  while (cin >> n >> k) {
    for (int i = 0; i < n; i++) {
      scanf("%I64d", &valu[i]);
      res[i] = valu[i];
    }
    if (k != 0) {
      for (int i = 0; i < n; i++) C[i] = getC(i, k - 1 + i);
      for (int i = 0; i < n; i++) {
        for (int j = i - 1; j >= 0; j--) {
          res[i] += (C[i - j] * valu[j]) % mod;
          res[i] %= mod;
        }
      }
    }
    for (int i = 0; i < n; i++)
      printf("%I64d%c", res[i], i == n - 1 ? '\n' : ' ');
  }
  return 0;
}
