use std::collections::{HashMap, HashSet}; fn main() { proconio::input! { n: u64, } if n >= 1000000007 { println!("0"); return; } //let mut memo = vec![]; let r = RESUME .iter() .copied() .rev() .skip_while(|x| x.0 > n) .next() .unwrap_or((1, 1)); let mut x = r.1; for i in (r.0..=n) { x = (x * i) % 1000000007; } println!("{x}"); } const RESUME: [(u64, u64); 100] = [ (10000000, 250015370), (20000000, 777847830), (30000000, 64381203), (40000000, 129227219), (50000000, 664720426), (60000000, 220551652), (70000000, 805011386), (80000000, 71626953), (90000000, 368173468), (100000000, 388742192), (110000000, 633943807), (120000000, 546160751), (130000000, 248863345), (140000000, 642800490), (150000000, 227253170), (160000000, 217956259), (170000000, 448399780), (180000000, 343122361), (190000000, 203128902), (200000000, 904824556), (210000000, 976400196), (220000000, 409788350), (230000000, 969665321), (240000000, 942841378), (250000000, 78633765), (260000000, 46429647), (270000000, 419288563), (280000000, 622773713), (290000000, 43950471), (300000000, 158036420), (310000000, 539867530), (320000000, 629028067), (330000000, 98679775), (340000000, 181067811), (350000000, 577131628), (360000000, 448714637), (370000000, 274699378), (380000000, 172718980), (390000000, 524877565), (400000000, 132400827), (410000000, 283566441), (420000000, 299777072), (430000000, 688241748), (440000000, 422054382), (450000000, 789638131), (460000000, 386613162), (470000000, 219084929), (480000000, 375238282), (490000000, 270146387), (500000000, 647619052), (510000000, 871756271), (520000000, 645927523), (530000000, 483519685), (540000000, 459833872), (550000000, 273602905), (560000000, 929096963), (570000000, 250231633), (580000000, 278589981), (590000000, 849449796), (600000000, 541794170), (610000000, 601214344), (620000000, 860331963), (630000000, 898831734), (640000000, 959047580), (650000000, 990713044), (660000000, 218658983), (670000000, 293444525), (680000000, 385243308), (690000000, 352821537), (700000000, 722869575), (710000000, 381109223), (720000000, 378511108), (730000000, 85458370), (740000000, 915965688), (750000000, 815695490), (760000000, 160874373), (770000000, 185206871), (780000000, 724450461), (790000000, 862837188), (800000000, 463715736), (810000000, 360855087), (820000000, 398991956), (830000000, 806738292), (840000000, 541775025), (850000000, 609437737), (860000000, 40420676), (870000000, 773978131), (880000000, 742263715), (890000000, 320097016), (900000000, 446595916), (910000000, 239856470), (920000000, 851897254), (930000000, 213673769), (940000000, 51083743), (950000000, 328555850), (960000000, 784853394), (970000000, 300038049), (980000000, 426045335), (990000000, 808434455), (1000000000, 900198419), ];