#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long ar[2003];
long long Pow(long long a, long long b) {
  long long c = a, ans = 1;
  for (long long i = 1; i <= b; i <<= 1) {
    if (b & i) ans = (ans * c) % 1000000007;
    c = (c * c) % 1000000007;
  }
  return ans;
}
int main() {
  scanf("%I64d%I64d", &n, &k);
  for (long long i = 1; i <= n; i++) scanf("%I64d", &ar[i]);
  for (long long i = 1; i <= n; i++) {
    long long sum = ar[i], t = 1;
    for (long long j = i - 1, x = 1, y = k; j >= 1; j--, x++, y++) {
      t = ((t * y) % 1000000007 * Pow(x, 1000000007 - 2)) % 1000000007;
      sum = (sum + (t * ar[j]) % 1000000007) % 1000000007;
    }
    printf("%I64d ", sum);
  }
  printf("\n");
  return 0;
}
