#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int a[2000];
long long ncr[2000];
int modpow(int a, int b) {
  if (b == 0) return 1;
  int c = modpow(a, b / 2);
  return 1LL * c * c % MOD * (b % 2 ? a : 1) % MOD;
}
long long choose(int n, int r) {
  if (r > n) return 0;
  if (ncr[r] > -1) return ncr[r];
  long long numerator = 1, denominator = 1;
  for (int i = 1; i <= r; i++) {
    numerator = numerator * (n - r + i) % MOD;
    denominator = denominator * i % MOD;
  }
  return ncr[r] = numerator * modpow(denominator, MOD - 2) % MOD;
}
int main() {
  int n, k;
  cin >> n >> k;
  fill(ncr, ncr + n, -1);
  for (int i = 0; i < n; i++) {
    int ai;
    cin >> ai;
    if (k == 0) {
      a[i] = ai;
      continue;
    }
    for (int j = i; j < n; j++)
      a[j] = (a[j] + ai * choose(k - 1 + j - i, j - i) % MOD) % MOD;
  }
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
