#include <bits/stdc++.h>
using namespace std;
long long ara[2003], co[2003], fact[2003], val[2003];
long long bigmod(long long b, long long p) {
  if (!p) return 1ll;
  long long ret = bigmod(b, p / 2);
  ret = (ret * ret) % 1000000007ll;
  if (p & 1ll) ret = (ret * b) % 1000000007ll;
  return ret;
}
int main() {
  fact[0] = 1ll;
  for (long long i = 1; i <= 2000; i++)
    fact[i] = (fact[i - 1] * i) % 1000000007ll;
  long long n, k;
  scanf("%lld %lld", &n, &k);
  for (int i = 0; i < n; i++) scanf("%lld", &ara[i]);
  if (k) {
    co[0] = 1;
    for (long long i = 1; i < n; i++) {
      long long p = i + k - 1;
      long long q = i;
      long long nume = 1ll;
      for (long long j = p - q + 1; j <= p; j++)
        nume = (nume * j) % 1000000007ll;
      long long deno = fact[q];
      deno = bigmod(deno, 1000000007ll - 2);
      co[i] = (nume * deno) % 1000000007ll;
    }
    for (int i = 0; i < n; i++)
      for (int j = 0, l = i; j <= i; j++, l--)
        val[i] = (val[i] + co[j] * ara[l]) % 1000000007ll;
    for (int i = 0; i < n; i++) printf("%lld ", val[i]);
    puts("");
  } else {
    for (int i = 0; i < n; i++) printf("%lld ", ara[i]);
    puts("");
  }
  return 0;
}
