#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
long long C[N][N];
long long A[N];
long long ans[N];
long long n, k;
long long expo(long long base, long long exp) {
  long long ans = 1;
  while (exp > 0) {
    if (exp & 1) {
      ans *= base;
      ans %= 1000000007;
    }
    base *= base;
    base %= 1000000007;
    exp >>= 1;
  }
  return ans;
}
int main() {
  scanf("%I64d%I64d", &n, &k), --k;
  for (int i = 0; i < n; ++i) scanf("%I64d", &A[i]);
  C[0][0] = 1;
  for (int i = 1; i < n; ++i)
    C[i][0] =
        ((((k + i) * C[i - 1][0]) % 1000000007) * expo(i, 1000000007 - 2)) %
        1000000007;
  for (int i = 1; i < n; ++i)
    for (int j = 1; j < i + 1; ++j) C[i][j] = C[i - 1][j - 1];
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) {
      ans[i] += A[j] * C[i][j];
      ans[i] %= 1000000007;
    }
  for (int i = 0; i < n; ++i) printf("%I64d ", ans[i]);
  return 0;
}
