#include <bits/stdc++.h>
using namespace std;
int n, k, a[2001];
unsigned long long s[2001], GT[2001], USED[200001];
const int base = 1e9 + 7;
unsigned long long IndianMul(unsigned long long a, unsigned long long b) {
  if (b == 0) return 0;
  unsigned long long t = IndianMul(a, b / 2);
  if ((b & 1) == 0) t = (t + t);
  if ((b & 1) == 1) t = (t + t + a);
  return t;
}
unsigned long long POW(unsigned long long a, unsigned long long n) {
  if (n == 0) return 1;
  if (n == 1) {
    return a;
  }
  if (n > 1) {
    unsigned long long temp = POW(a, n / 2);
    if ((n & 1) == 0)
      return (temp * temp) % base;
    else
      return ((temp * temp) % base * a) % base;
  }
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (k <= 0)
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
  else if (k > 0) {
    GT[0] = 1;
    for (int i = 1; i <= n; i++) {
      GT[i] = (GT[i - 1] * i) % base;
    }
    USED[0] = 1;
    for (int j = 1; j <= n; j++) {
      for (int i = k; i <= k + n - j - 1; i++) {
        USED[i - k + 1] = (USED[i - k] * i) % base;
      }
    }
    for (int i = 1; i <= n; i++) {
      for (int j = i; j >= 1; j--) {
        unsigned long long x, y;
        x = (USED[i - j] * POW(GT[i - j], base - 2)) % base;
        y = IndianMul(x, a[j]) % base;
        s[i] = (s[i] + y) % base;
      }
      cout << s[i] << " ";
    }
  }
}
