program fusing_slimes
  implicit none
  integer(8), parameter :: md = 1000000007
  integer :: n, i, j
  integer(8) :: x(100000) = 0, p = 0, d = 0, k = 1
  read(*,*) n
  read(*,*) x(1:n)
  do i = 1, n-1
    p = mod(p+inv(int(i,8)),md)
    d = mod(d+mod((x(i+1)-x(i))*p,md),md)
    k = mod(k*i,md)
  end do
  write(*,'(i0)') mod(d*k,md)
contains
  function inv(n) result(y)
    integer(8), intent(in) :: n
    integer(8) :: a, b, x, y, t, q
    a = modulo(n,md)
    b = md
    x = 0_8
    y = 1_8
    do while (b /= 0_8)
      q = a/b
      t = b
      b = mod(a,b)
      a = t
      t = y
      y = x
      x = t-q*x
    end do
    y = modulo(y,md)
  end
end program fusing_slimes