#include <bits/stdc++.h>
using namespace std;
int a[20];
int s[20];
long long arr[2005];
long long prv[2005];
long long rev(long long x) {
  long long deg = 1000000007 - 2, ret = 1;
  while (deg) {
    if (deg & 1) {
      ret *= x;
      ret %= 1000000007;
    }
    x *= x;
    x %= 1000000007;
    deg >>= 1;
  }
  return ret;
}
long long C(long long n, long long k) {
  long long ret = 1;
  for (int i = 0; i < k; ++i) {
    ret *= (n - i);
    ret %= 1000000007;
    ret *= rev(i + 1);
    ret %= 1000000007;
  }
  return ret;
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; ++i) {
    prv[i] = C(k + i - 1, i);
  }
  for (int i = 0; i < n; ++i) {
    long long sum = 0;
    for (int j = 0; j <= i; ++j) {
      sum += prv[i - j] * arr[j];
      sum %= 1000000007;
    }
    cout << sum << " ";
  }
  cout << endl;
  return 0;
}
