#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long INF = 1000000000000000000LL;
struct mint {
  long long x;
  mint(long long x = 0) : x((x % mod + mod) % mod) {}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod - a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(long long t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint& operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};
long long factorial(long long n) {
  long long answer = 1;
  while (n > 1) {
    answer *= n;
    n--;
  }
  return answer;
}
mint combination(long long n, long long r) {
  return factorial(n) / (factorial(r) * factorial(n - r));
}
mint permutation(long long n, long long r) {
  return factorial(n) / factorial(n - r);
}
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
template <typename T>
void remove(std::vector<T>& vector, unsigned int index) {
  vector.erase(vector.begin() + index);
}
map<long long, long long> prime_factor(long long n) {
  map<long long, long long> ret;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n != 1) ret[n] = 1;
  return ret;
}
vector<long long> divisor(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}
bool compare_by_b(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}
vector<long long> Eratosthenes(const long long N) {
  bool is_prime[1000000 + 1];
  vector<long long> P;
  for (long long i = 0; i <= N; i++) {
    is_prime[i] = true;
  }
  for (long long i = 2; i <= N; i++) {
    if (is_prime[i]) {
      for (long long j = 2 * i; j <= N; j += i) {
        is_prime[j] = false;
      }
      P.emplace_back(i);
    }
  }
  return P;
}
int main() {
  int n;
  cin >> n;
  vector<long long> x(n);
  for (int i = 0; i < (n); i++) {
    cin >> x[i];
  }
  vector<long long> y(n);
  for (int i = 0; i < (n); i++) {
    y[i] = x[i];
  }
  long long sum = 0;
  long long count = 0;
  do {
    count++;
    vector<long long> yy(n);
    yy = y;
    long long i = 1;
    y.erase(y.begin());
    while (yy.size() != 1) {
      sum += yy[0];
      yy.erase(yy.begin() + 1);
    }
  } while (next_permutation(y.begin(), y.end()));
  double sum2 = sum / (double)count;
  long long answer = sum2 * factorial(n - 1);
  cout << answer % mod << endl;
  return 0;
}
