#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, k, a[2005], ans[2005], c[2010];
long long qpow(long long a, long long b) {
  long long ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ans * a % mod;
    b /= 2;
    a = a * a % mod;
  }
  return ans;
}
long long C(long long n, long long m) {
  if (m == 0) return 1;
  long long ans = n % mod, k = 1;
  for (int i = 2; i <= m; ++i) {
    ++k;
    ans = ans * ((n - k + 1) % mod) % mod * qpow(k, mod - 2) % mod;
  }
  return ans;
}
void getc() {
  long long t = k - 1;
  c[0] = 1;
  for (int i = 1; i <= 2005; ++i) {
    c[i] = (c[i - 1] + C(t + i - 1, i)) % mod;
  }
}
int main() {
  cin >> n >> k;
  getc();
  for (int i = 1; i <= n; ++i) cin >> a[i];
  if (k == 0) {
    for (int i = 1; i <= n; ++i) cout << a[i] << ' ';
    return 0;
  }
  if (k == 1) {
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= i; ++j) ans[i] = (ans[i] + a[j]) % mod;
    for (int i = 1; i <= n; ++i) cout << ans[i] << ' ';
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= i; ++j) {
      ans[i] = (ans[i] + a[j] * (c[i - j] % mod)) % mod;
    }
  for (int i = 1; i <= n; ++i) {
    cout << ans[i] << ' ';
  }
  return 0;
}
