#include <bits/stdc++.h>
using namespace std;
long long a[2010], n, k, ans[2010];
void eea(long long a, long long b, long long& gcd, long long& x, long long& y) {
  x = 0, y = 1;
  long long u = 1, v = 0, m, n, q, r;
  gcd = b;
  while (a != 0) {
    q = gcd / a;
    r = gcd % a;
    m = x - u * q;
    n = y - v * q;
    gcd = a;
    a = r;
    x = u;
    y = v;
    u = m;
    v = n;
  }
}
long long divide(long long A, long long B) {
  long long gcd, x, y;
  eea(B, 1000000007, gcd, x, y);
  long long q = A / gcd;
  return ((x + 1000000007) * q) % (1000000007 / gcd);
}
int main() {
  while (cin >> n >> k) {
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) {
      ans[i] = a[i];
      long long c = k;
      long long r = 1, N = k;
      for (int j = i - 1; j >= 0; j--) {
        ans[i] = (ans[i] + c * a[j] % 1000000007) % 1000000007;
        c = ((c * (N + 1)) % 1000000007);
        c = divide(c, r + 1);
        r++;
        N++;
      }
    }
    cout << ans[0];
    for (int i = 1; i < n; i++) cout << " " << ans[i];
    cout << endl;
  }
  return 0;
}
