proc getchar_unlocked():char {. importc:"getchar_unlocked",header: "" .} proc scan(): int = while true: let k = getchar_unlocked() if k < '0': break result = 10 * result + k.ord - '0'.ord const MOD = 1000000007 const preCalcedNum = 1_00_0000 const results = (proc ():seq[int] = result = newSeq[int](preCalcedNum+1) var ans = 1 for i in 1..preCalcedNum: let m = (i * (2 * i - 1)) mod MOD ans = ( ans * m ) mod MOD result[i] = ans )() let n = scan() echo results[n]