#include <bits/stdc++.h>
using namespace std;
const int M = 100010, mod = 1000000007;
long long bigMod(long long first, long long n) {
  if (n == 0) return 1;
  long long temp = bigMod(first, n / 2);
  return n % 2 == 0 ? (temp * temp) % mod
                    : (first * ((temp * temp) % mod)) % mod;
}
long long coef[M];
long long A[M];
int main() {
  ios_base::sync_with_stdio(false);
  long long n, k, i, j;
  cin >> n >> k;
  coef[0] = 1;
  for (i = 1; i <= n; i++) {
    coef[i] = (((coef[i - 1] * k) % mod) * bigMod(i, mod - 2)) % mod;
    k++;
  }
  for (i = 0; i < n; i++) {
    cin >> A[i];
    long long sum = 0;
    for (j = 0, k = i; k >= 0; k--, j++) {
      sum += (coef[j] * A[k]) % mod;
      sum %= mod;
    }
    cout << sum << " ";
  }
  cout << endl;
  return 0;
}
