#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  vector<long long> x(N);
  for (int i = 0; i < (N); ++i) cin >> x[i];
  long long factorial = 0;
  for (int i = 0; i < (N - 1); ++i) {
    if (i == 0)
      factorial = 1;
    else
      factorial *= i + 1;
  }
  vector<double> c(N - 1);
  double tmp = 0;
  for (int i = 0; i < (N - 1); ++i) {
    tmp += (double)1 / (i + 1);
    c[i] = tmp;
  }
  double sum = 0.0;
  for (int i = 0; i < (N - 1); ++i) {
    sum += c[i] * (x[i + 1] - x[i]);
  }
  cout << sum << endl;
  sum = sum * factorial;
  long long ans = (long long)sum;
  ans = ans % MOD;
  cout << ans << endl;
  return 0;
}
