import Data.Bool import qualified Data.List as List main :: IO () main = readLn >>= putStrLn . bool "NO" "YES" . (>= 3) . length . List.group . primeFactors primeFactors :: Int -> [Int] primeFactors m = f m (head primes) (tail primes) where f m n ns | m < 2 = [] | m `mod` n == 0 = n : f (m `div` n) n ns | otherwise = f m (head ns) (tail ns) primes :: [Int] primes = f [2..] where f (p : ns) = p : f [n | n <- ns, n `mod` p /= 0]