import Control.Applicative
import Control.Monad
import Data.List

p = 10 ^ 9 + 7

main :: IO ()
main = do
    n <- readLn :: IO Int
    let ans = foldr1 (\x acc -> (x * acc) `mod` p) [1 .. n]
    print ans