#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
template <class T>
inline void chmax(T &ans, T t) {
  if (t > ans) ans = t;
}
template <class T>
inline void chmin(T &ans, T t) {
  if (t < ans) ans = t;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n), sum(n + 1);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> two(n + 10, 1);
  for (int i = n; i > 0; --i) {
    for (int j = i - 1; j > 0; --j) {
      two[i] += j % 1000000007;
    }
  }
  for (int i = 0; i <= n; ++i) {
    cout << two[i] << endl;
  }
  long long ans = 0;
  map<int, int> mp;
  for (long long i = 1; i < n; i++) {
    for (int j = i - 1; j >= 0; --j) {
      long long cnt = 0;
      long long sub = a[i] - a[j];
      cnt = two[j] * two[max(n - 2 - i, 0LL)];
      cnt *= sub;
      cnt *= 1000000007;
    }
  }
  cout << ans << endl;
}
