#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> x(n);
  for (int i = 0; i < (n); i++) cin >> x[i];
  vector<long long> fact(n + 1);
  fact[0] = 1;
  for (int i = 1; i <= n; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= 1000000007;
  }
  long long ans = 0;
  long long sum = 0;
  for (int i = 0; i < n - 1; i++) {
    long long coeff = fact[n - 1] / (i + 1) % 1000000007;
    ans -= coeff * x[i] % 1000000007;
    cout << ans << endl;
    sum += coeff;
    ans %= 1000000007;
    sum %= 1000000007;
  }
  ans += sum * x[n - 1];
  ans %= 1000000007;
  cout << ans << endl;
}
