/* imports all std modules {{{*/
import
  std.algorithm,
  std.array,
  std.ascii,
  std.base64,
  std.bigint,
  std.bitmanip,
  std.compiler,
  std.complex,
  std.concurrency,
  std.container,
  std.conv,
  std.csv,
  std.datetime,
  std.demangle,
  std.encoding,
  std.exception,
  std.file,
  std.format,
  std.functional,
  std.getopt,
  std.json,
  std.math,
  std.mathspecial,
  std.meta,
  std.mmfile,
  std.net.curl,
  std.net.isemail,
  std.numeric,
  std.parallelism,
  std.path,
  std.process,
  std.random,
  std.range,
  std.regex,
  std.signals,
  std.socket,
  std.stdint,
  std.stdio,
  std.string,
  std.system,
  std.traits,
  std.typecons,
  std.uni,
  std.uri,
  std.utf,
  std.uuid,
  std.variant,
  std.zip,
  std.zlib;
/*}}}*/

/* libmod {{{*/
struct ModCalc(N) if (isIntegral!N) {
 public:
  N mod(N n) const {
    const x = n%m;
    return x < 0? x+m: x;
  }
  N inv(N a) const {
    N b = m, u = 1, v = 0;
    while (b) {
      const t = a / b;
      a -= t*b; swap(a, b);
      u -= t*v; swap(u, v);
    }
    return mod(u);
  }

  N add(N l, N r) const {
    return mod(mod(l) + mod(r));
  }
  N sub(N l, N r) const {
    return mod(mod(l) - mod(r));
  }
  N mul(N l, N r) const {
    return mod(mod(l) * mod(r));
  }
  N div(N l, N r) const {
    assert(r != 0);
    return mod(mod(l) * inv(mod(r)));
  }

  N m = 1000000007;
}
/*}}}*/

/+---test
3
1 2 3
---+/
/+---test
4
1 2 3 4
---+/
/+---test
12
161735902 211047202 430302156 450968417 628894325 707723857 731963982 822804784 880895728 923078537 971407775 982631932
---+/

enum M = 1000000007;
enum MC = ModCalc!long();

void main(string[] args) {
  const N = readln.chomp.to!long;
  const X = readln.split.map!(to!long).array;

  auto fact = new long[](N+1);
  fact[0] = 1;
  foreach (i; 1..N+1) fact[i] = MC.mul(fact[i-1], i);

  auto su = new long[](N);
  su[$-1] = 0;
  foreach_reverse (i; 0..N-1) su[i] = MC.add(su[i+1], X[N-1]-X[i]);

  long ans;
  foreach (i; 0..N-1) {
    ans = MC.add(ans, MC.mul(su[i], MC.div(fact[N-1], N-i-1)));
  }
  ans.writeln;
}
