import Data.List (foldl')

main :: IO ()
main = do
    n <- read <$> getLine
    answer $ solve n

type Answer = Int
answer :: Answer -> IO ()
answer = print

constMod = 10 ^ 9 + 7

solve :: Int -> Answer
solve = foldl' ((.) (`mod` constMod) . (*)) 1 . enumFromTo 1
