#include <bits/stdc++.h>
using namespace std;
const int N = 2009, mod = 1e9 + 7;
int n, k, C[N], a[N], inv[N], ans[N];
inline void Init() {
  inv[0] = inv[1] = 1;
  for (int i = 2; i < N; i++)
    inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
  C[0] = 1;
  for (int i = 1; i < N; i++)
    C[i] = 1ll * C[i - 1] * inv[i] % mod * (i + k - 1) % mod;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (!k) {
    {
      for (int i = 1; i <= n; i++) printf("%d ", a[i] % mod);
    }
    return 0;
  }
  Init();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= i; j++)
      ans[i] = (ans[i] + 1ll * a[j] * C[i - j] % mod) % mod;
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
