#include <bits/stdc++.h>
using namespace std;
long long inv[2005], c[2005], a[2005], n, k;
long long getc(int n, int m) {
  long long ans = 1;
  for (int i = 1; i <= m; i++)
    ans = ((ans * inv[i]) % 1000000007 * (n - i + 1) % 1000000007);
  return ans;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (k == 0) {
    cout << a[0];
    for (int i = 1; i < n; i++) cout << " " << a[i];
    cout << endl;
    return 0;
  }
  inv[0] = inv[1] = 1;
  for (int i = 2; i < 2005; i++)
    inv[i] =
        (((-1000000007 / i * inv[1000000007 % i]) % 1000000007) + 1000000007) %
        1000000007;
  for (int i = 0; i < n; i++) c[i] = getc(i + k - 1, i);
  for (int i = 0; i < n; i++) {
    long long ans = 0;
    for (int j = 0; j <= i; j++) ans = (ans + a[j] * c[i - j]) % 1000000007;
    if (!i)
      cout << ans;
    else
      cout << " " << ans;
  }
  cout << endl;
  return 0;
}
