use io::*;
use modular::*;

// use std::collections::BTreeMap;

// fn bf(
//     cur: usize,
//     n: usize,
//     used: i64,
//     hist: &mut Vec<usize>,
//     mm: &mut BTreeMap<i64, i64>,
// ) -> Modular {
//     if cur == n - 1 {
//         let mut v = vec![false; n];
//         let mut pn = 0;
//         for i in 0..n - 1 {
//             if !v[hist[i]] {
//                 pn += 1;
//             }
//             if !v[hist[i] + 1] {
//                 pn += 1;
//             }
//             v[hist[i]] = true;
//             v[hist[i] + 1] = true;

//             if pn == n {
//                 // if i + 1 == (n + 1) / 2 {
//                 //     println!("{:?}", hist);
//                 // }
//                 *mm.entry(i as i64 + 1).or_insert(0) += 1;
//                 return (i as i64 + 1).into();
//             }
//         }

//         unreachable!();
//     }

//     let mut ret = 0.into();

//     for i in 0..n - 1 {
//         if used & (1 << i) != 0 {
//             continue;
//         }

//         hist[cur] = i;
//         ret += bf(cur + 1, n, used | (1 << i), hist, mm);
//     }

//     ret
// }

fn main() {
    // for n in 2..12 {
    //     let mut hist = vec![0; n - 1];
    //     let mut mm = BTreeMap::new();
    //     println!("{}: {}", n, bf(0, n, 0, &mut hist, &mut mm));

    //     let mut acc: i64 = 0;

    //     for (k, v) in mm {
    //         let p1: i64 = (1..k + 1).product();
    //         let p2: i64 = (1..(n as i64 - 1 - k + 1)).product();

    //         // let cur = p1 * p2 - acc;

    //         // println!("  * k={}, v={}, cur={}", k, v, cur);
    //         assert!((v + acc) % (p1 * p2) == 0);
    //         // assert!((v + acc) % (p1 * p2) == 0);
    //         println!("  * {}: {}, {}", k, v, (v + acc) / (p1 * p2));

    //         acc += v;
    //     }
    // }

    let con = read_string();
    let mut sc = Scanner::new(&con);

    let n: usize = sc.next();

    let mut fact_tbl: Vec<Modular> = vec![1.into(); n + 1];
    let mut ifact_tbl: Vec<Modular> = vec![1.into(); n + 1];

    for i in 1..n + 1 {
        fact_tbl[i] = fact_tbl[i - 1] * (i as i64);
        ifact_tbl[i] = fact_tbl[i].recip();
    }

    let fact = |n| -> Modular { fact_tbl[n] };
    let ifact = |n| -> Modular { ifact_tbl[n] };
    let comb = |n, k| -> Modular { fact(n) * ifact(k) * ifact(n - k) };

    let mut acc: Modular = 0.into();
    let mut ans: Modular = 0.into();

    for k in (n + 1) / 2..n {
        let p1 = fact(k);
        let p2 = fact(n - 1 - k);
        let t = comb(k - 1, n - 1 - k);

        let v: Modular = t * (p1 * p2) - acc;

        ans += v * (k as i64);
        acc += v;
    }

    println!("{}", ans);
}

//-----

pub mod io {
    use std;

    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T>(&mut self) -> T
        where
            T: std::str::FromStr,
            <T as std::str::FromStr>::Err: std::fmt::Debug,
        {
            let s = self.iter.next().unwrap();
            s.parse::<T>().unwrap()
        }
    }

    pub fn read_string() -> String {
        use std::io::Read;

        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }

    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}

pub mod modular {
    const M: i64 = 1000000007;

    #[derive(Debug, Clone, Copy, Default, PartialOrd, Ord, PartialEq, Eq)]
    pub struct Modular(i64);

    impl ::std::fmt::Display for Modular {
        fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
            write!(f, "{}", self.0)
        }
    }

    impl Modular {
        pub fn new(v: i64) -> Modular {
            Modular(v % M)
        }

        pub fn pow(self, mut r: i64) -> Modular {
            let mut k = self;
            let mut ret = 1.into();

            while r > 0 {
                if r % 2 != 0 {
                    ret = ret * k;
                }
                r /= 2;
                k = k * k;
            }

            ret
        }

        // This requires M is prime
        pub fn recip(self) -> Modular {
            self.pow(M - 2)
        }
    }

    use std::ops::*;

    impl<T: Into<Modular>> Add<T> for Modular {
        type Output = Modular;
        fn add(self, rhs: T) -> Self::Output {
            Modular::new(self.0 + rhs.into().0)
        }
    }
    impl<T: Into<Modular>> AddAssign<T> for Modular {
        fn add_assign(&mut self, rhs: T) {
            *self = *self + rhs;
        }
    }

    impl<T: Into<Modular>> Sub<T> for Modular {
        type Output = Modular;
        fn sub(self, rhs: T) -> Self::Output {
            Modular::new(self.0 - rhs.into().0 + M)
        }
    }
    impl<T: Into<Modular>> SubAssign<T> for Modular {
        fn sub_assign(&mut self, rhs: T) {
            *self = *self - rhs;
        }
    }

    impl<T: Into<Modular>> Mul<T> for Modular {
        type Output = Modular;
        fn mul(self, rhs: T) -> Self::Output {
            Modular::new(self.0 * rhs.into().0)
        }
    }
    impl<T: Into<Modular>> MulAssign<T> for Modular {
        fn mul_assign(&mut self, rhs: T) {
            *self = *self * rhs;
        }
    }

    impl<T: Into<Modular>> Div<T> for Modular {
        type Output = Modular;
        fn div(self, rhs: T) -> Self::Output {
            self * rhs.into().recip()
        }
    }
    impl<T: Into<Modular>> DivAssign<T> for Modular {
        fn div_assign(&mut self, rhs: T) {
            *self = *self / rhs;
        }
    }

    impl Neg for Modular {
        type Output = Modular;
        fn neg(self) -> Self::Output {
            Modular(0) - self
        }
    }

    impl<T: ::std::convert::Into<i64>> ::std::convert::From<T> for Modular {
        fn from(v: T) -> Self {
            Modular::new(v.into())
        }
    }
}


Measured memory_bytes: 20732