#include <bits/stdc++.h>
using namespace std;
static const int INTINF = (2147483647);
static const long long LLINF = (9223372036854775807);
static const int MAX = 2000 + 1;
static const long double MOD = 1e9 + 7;
namespace Printer {
template <class T>
void print(T x) {
  cout << x << endl;
}
template <class T>
void print(T x, T y) {
  cout << x << "," << y << endl;
}
template <class T>
void print(vector<T> v) {
  for (int i = 0; i < (v.size()); ++i) {
    if (i) cout << " ";
    cout << v[i];
  }
  cout << endl;
}
template <class T>
void print(vector<vector<T> > vv) {
  for (int i = 0; i < (vv.size()); ++i) {
    for (int j = 0; j < (vv[i].size()); ++j) {
      if (j) cout << " ";
      cout << vv[i][j];
    }
    cout << endl;
  }
}
void print(pair<int, int> p) {
  cout << "(" << p.first << ", " << p.second << ")" << endl;
}
};  // namespace Printer
using namespace Printer;
long long N;
long double X[MAX];
long double dp[MAX][MAX];
long double calc(int a, int b, double num) {
  if (dp[a][b] != -1) {
    return dp[a][b];
  }
  dp[a][b] = 0;
  if (b - a <= 1) {
    dp[a][b] = X[b] - X[a];
    dp[a][b] /= num;
  } else {
    dp[a][b] += (X[b] - X[a] + calc(a + 1, b, num - 1)) / num;
    dp[a][b] += (calc(a, b - 1, num - 1) + X[b] - X[b - 1]) / num;
  }
  return dp[a][b];
}
long double solve(long double a, long double num) {
  if (num == 1) {
    return a * num;
  }
  long double tmp = solve(a, num - 1);
  return tmp * num;
}
int main(int argc, const char* argv[]) {
  cin >> N;
  for (int i = 0; i < (N); ++i) cin >> X[i];
  for (int i = 0; i < (MAX); ++i) {
    fill(dp[i], dp[i] + MAX, -1);
  }
  long double ans = calc(0, N - 1, N - 1);
  ans = solve(ans, N - 1);
  long long ans2 = long long(ans);
  ans2 %= long long(MOD);
  cout << ans2 << endl;
  return 0;
}
