const MOD: usize = 1e9 as usize + 7; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut result = vec![0usize; n+1]; result[1] = 1; let mut oddsum = 1usize; let mut evensum = 0usize; for i in 2..=n { if i % 2 == 0 { result[i] = i * oddsum % MOD; evensum += result[i]; evensum %= MOD; } else { result[i] = i * evensum % MOD; oddsum += result[i]; oddsum %= MOD; } } println!("{}", result[n]); }