#include <bits/stdc++.h>
using namespace std;
const int N = 2005, mod = 1000000007;
int a[N];
int modex(long long a, int b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long large[N];
long long large_comb(int n, int k) {
  if (n < k) return 0;
  long long res = 1;
  for (int i = n; i > n - k; --i) res = res * i % mod;
  for (int i = 1; i <= k; ++i) res = res * modex(i, mod - 2) % mod;
  return res;
}
long long calc[N], inv[N];
long long c(int n, int k) {
  if (n < k) return 0;
  return (calc[n] * inv[n - k] % mod) * inv[k] % mod;
}
long long small_comb(int k, int n) {
  long long res = 0;
  for (int i = 0; i < n; ++i) {
    res += large[i] * c(k, i);
    res %= mod;
  }
  return res;
}
long long v[N];
int main() {
  calc[0] = inv[0] = 1;
  for (int i = 1; i < N; ++i) {
    calc[i] = calc[i - 1] * i % mod;
    inv[i] = modex(calc[i], mod - 2);
  }
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  if (k == 0) {
    for (int i = 0; i < n; ++i) printf("%d ", a[i]);
    return 0;
  }
  k--;
  for (int i = 0; i < n; ++i) large[i] = large_comb(k, i);
  for (int i = 0; i < n; ++i) v[i] = small_comb(i, n);
  for (int i = 0; i < n; ++i) {
    long long sum = 0;
    for (int k = i; k >= 0; k--) {
      sum += a[i - k] * v[k];
      sum %= mod;
    }
    cout << sum << " ";
  }
  cout << endl;
  return 0;
}
