#include <bits/stdc++.h>
using namespace std;
const long long MAX = 100010;
long long n;
long long memo[MAX];
long long factorize(long long x) {
  if (memo[x] != -1) return memo[x];
  if (x == 1) return memo[1] = 1;
  return x * factorize(x - 1) % 1000000007;
}
long long summalize(long long x) {
  long long rep = 0;
  for (int i = 1; i <= x; i++) rep = (rep + factorize(n - 1) / i) % 1000000007;
  return rep;
}
int main() {
  cin >> n;
  long long x[MAX];
  for (long long i = 0; i < n; i++) {
    cin >> x[i];
    memo[i + 1] = -1;
  }
  long long ans = 0;
  long long s = factorize(n);
  long long t = summalize(n - 1);
  for (long long i = 1; i <= n; i++) {
    if (i < n)
      ans = (ans - (factorize(n - 1) / i) * x[i - 1] + 1000000007) % 1000000007;
    else
      ans = (ans + t * x[n - 1]) % 1000000007;
  }
  cout << ans << endl;
  return 0;
}
