import Data.Bool import Data.List primes :: [Int] primes = 2:3:[x | i<-[1..], j<-[-1,1], let x = 6*i+j, isPrime x] where isPrime n = null [i | i <- takeWhile (\x -> x*x <= n) primes, mod n i == 0] main = readLn >>= putStrLn . bool "NO" "YES" . (\x -> any (\p -> mod x p == 0) (takeWhile (<= (sq x)) primes)) where sq = floor . sqrt . fromIntegral