#include <bits/stdc++.h>
int a[2010], s[2010], n, k;
int add(int x, int y) { return (x += y) < 1000000007 ? x : x - 1000000007; }
int mul(int x, int y) { return (int)((long long int)x * y % 1000000007); }
int inv(int x) {
  int r = 1;
  for (int y = 1000000007 - 2;;) {
    if (y & 1) r = mul(r, x);
    if (y >>= 1)
      x = mul(x, x);
    else
      break;
  }
  return r;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int c = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n - i; j++) {
      s[j + i] = add(s[j + i], mul(a[j], c));
    }
    c = mul(mul(c, k + i), inv(i + 1));
  }
  for (int i = 0; i < n; i++) printf("%d%c", s[i], i < n - 1 ? ' ' : '\n');
  return 0;
}
