#[test]
fn test_solve() {
    assert_eq!(solve("3\n1 2 3\n"), "5\n");
    assert_eq!(solve("12\n161735902 211047202 430302156 450968417 628894325 707723857 731963982 822804784 880895728 923078537 971407775 982631932\n"), "750927044\n");
}

fn solve(src: &str) -> String {
    let mut sc = Scanner::from_str(src);

    let n: usize = sc.read();
    let x: Vec<u64> = (0..n).map(|_| sc.read()).collect();
    let d: Vec<u64> = (0..n-1).map(|i| x[i+1]-x[i]).collect();

    //let half = Finite(1) / 2;
    let mut ans = Finite(0);
    //let mut acc = Finite(0);
    for i in 0..n {
        let mut tmp = Finite(0);
        for j in 1..(n-i) {
            tmp += Finite(d[i+j-1]) / (j as u64);
        }
        ans += tmp;
    }
    for i in 1..n {
        ans *= i as u64;
    }

    format!("{}\n", ans)
}

const MOD: u64 = 1_000_000_007;
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
struct Finite(u64);
impl Finite {
    pub fn new(n: u64) -> Self {
        Finite(n % MOD)
    }
    pub fn pow(self, mut exp: u32) -> Self {
        let mut base = self.0;
        let mut acc = 1;
        while exp > 1 {
            if (exp & 1) == 1 {
                acc = acc * base % MOD;
            }
            exp >>= 1;
            base = base * base % MOD;
        }
        if exp == 1 {
            acc = acc * base % MOD;
        }
        Finite(acc)
    }
}
impl std::fmt::Display for Finite {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        write!(f, "{}", self.0)
    }
}
impl std::ops::Add for Finite {
    type Output = Self;
    fn add(self, rhs: Self) -> Self {
        Finite((self.0 + rhs.0) % MOD)
    }
}
impl std::ops::Add<u64> for Finite {
    type Output = Self;
    fn add(self, rhs: u64) -> Self {
        Finite((self.0 + rhs) % MOD)
    }
}
impl std::ops::AddAssign for Finite {
    fn add_assign(&mut self, rhs: Self) {
        self.0 = (self.0 + rhs.0) % MOD;
    }
}
impl std::ops::AddAssign<u64> for Finite {
    fn add_assign(&mut self, rhs: u64) {
        self.0 = (self.0 + rhs) % MOD;
    }
}
impl std::ops::Sub for Finite {
    type Output = Self;
    fn sub(self, rhs: Self) -> Self {
        Finite((self.0 + MOD - rhs.0) % MOD)
    }
}
impl std::ops::Sub<u64> for Finite {
    type Output = Self;
    fn sub(self, rhs: u64) -> Self {
        Finite((self.0 + MOD - rhs) % MOD)
    }
}
impl std::ops::SubAssign for Finite {
    fn sub_assign(&mut self, rhs: Self) {
        self.0 = (self.0 + MOD - rhs.0) % MOD;
    }
}
impl std::ops::SubAssign<u64> for Finite {
    fn sub_assign(&mut self, rhs: u64) {
        self.0 = (self.0 + MOD - rhs) % MOD;
    }
}
impl std::ops::Mul for Finite {
    type Output = Self;
    fn mul(self, rhs: Self) -> Self {
        Finite(self.0 * rhs.0 % MOD)
    }
}
impl std::ops::Mul<u64> for Finite {
    type Output = Self;
    fn mul(self, rhs: u64) -> Self {
        Finite(self.0 * rhs % MOD)
    }
}
impl std::ops::MulAssign for Finite {
    fn mul_assign(&mut self, rhs: Self) {
        self.0 = self.0 * rhs.0 % MOD;
    }
}
impl std::ops::MulAssign<u64> for Finite {
    fn mul_assign(&mut self, rhs: u64) {
        self.0 = self.0 * rhs % MOD;
    }
}
impl std::ops::Div for Finite {
    type Output = Self;
    fn div(self, rhs: Self) -> Self {
        self * rhs.pow((MOD - 2) as u32)
    }
}
impl std::ops::Div<u64> for Finite {
    type Output = Self;
    fn div(self, rhs: u64) -> Self {
        self * Finite(rhs).pow((MOD - 2) as u32)
    }
}
impl std::ops::DivAssign for Finite {
    fn div_assign(&mut self, rhs: Self) {
        *self = *self * rhs.pow((MOD - 2) as u32);
    }
}
impl std::ops::DivAssign<u64> for Finite {
    fn div_assign(&mut self, rhs: u64) {
        *self = *self * Finite(rhs).pow((MOD - 2) as u32);
    }
}

fn main() {
    let mut buf = String::new();
    use std::io;
    use std::io::{Read, Write};
    io::stdin().read_to_string(&mut buf).unwrap();
    io::stdout().write_all(solve(&buf).as_bytes()).unwrap();
}

struct Scanner<'a>(std::str::SplitWhitespace<'a>);
impl<'a> Scanner<'a> {
    fn from_str(src: &str) -> Scanner {
        Scanner(src.split_whitespace())
    }
    fn get(&mut self) -> &str {
        self.0.next().unwrap()
    }
    fn read<T: std::str::FromStr>(&mut self) -> T {
        self.get().parse().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> {
        self.get().chars().collect()
    }
}