import Data.List

main = do
  li <- getLine
  let n = read li
  let ans = compute n
  print ans

base = 1000000007

compute :: Int -> Int
compute n = foldl' f 1 [1..n] where
  f a n = a * n `mod` base
