#include <bits/stdc++.h>
using namespace std;
const int N = 2000 + 10, M = 1000000000 + 7;
int n, k, a[N], comb[N];
int pw(int a, int b) {
  long long ans = 1;
  for (int i = 31; i >= 0; i--) {
    ans *= ans;
    ans %= M;
    if ((b >> i) & 1) {
      ans *= a;
      ans %= M;
    }
  }
  return ans;
}
int C(int b, int a) {
  long long sur = 1, makh = 1;
  for (int i = b; i > b - a; i--) {
    sur *= (long long)i;
    sur %= M;
  }
  for (int i = 1; i <= a; i++) {
    makh *= i;
    makh %= M;
  }
  long long ans = (long long)sur * (long long)pw(makh, M - 2);
  return ans % M;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (k == 0) {
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
    return 0;
  }
  k--;
  for (int i = 0; i < n; i++) comb[i] = C(k + i, i);
  for (int i = 0; i < n; i++) {
    long long ans = 0;
    for (int j = 0; j <= i; j++) {
      ans += (long long)comb[i - j] * (long long)a[j];
      ans %= M;
    }
    cout << ans << " ";
  }
  cout << endl;
  return 0;
}
