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 results = (proc ():seq[int] = result = newSeq[int]() var ans = 1 for i in 1..4_000_000: let m = (i * (2 * i - 1)) mod MOD ans = ( ans * m ) mod MOD result &= ans )() let n = scan() echo results[0] # echo results[n]