import Data.List

f n k c
  | n == 1 = c
  | q == 0 = f q k (c + 1)
  | otherwise = (c + 1) %*% f n (k + 1) 0

(%*%) x y = (x * y) `mod` 1000000007
 
main = do
  n <- readLn
  print $ f (fact n) 2 0

fact n = foldl' (%*%) 1 [1..n]