import Data.Bool import qualified Data.List as List main :: IO () main = readLn >>= putStrLn . bool "NO" "YES" . (>= 3) . length . concat . List.group . primeFactors primeFactors :: Integral int => int -> [int] primeFactors n = case factors of [] -> [n] _ -> factors ++ primeFactors (n `div` (head factors)) where factors = take 1 $ filter (\x -> (n `mod` x) == 0) [2 .. n-1]