#include <bits/stdc++.h>
using namespace std;
int calc_kaizyou(int kaizyou) {
  int ans = 1;
  for (int i = 1; i <= kaizyou; i++) ans *= i;
  return ans;
}
int main() {
  int N;
  cin >> N;
  vector<int> x(N);
  for (int i = 0; i < N; i++) cin >> x.at(i);
  long long sum = 0;
  for (int i = 1; i < N; i++) {
    sum += x.at(i);
  }
  int kaizyou = calc_kaizyou(N - 2);
  long long int MOD = 1000000007;
  long long int ans = sum * kaizyou % MOD;
  cout << ans << endl;
  return 0;
}
