judge :: Int -> String -> String judge 1 _ = "NO" judge 2 s = if s == "00" || s == "11" then "YES" else "NO" judge 3 s = if s == "010" || s == "101" then "NO" else "YES" judge _ _ = "YES" main :: IO () main = do n <- readLn :: IO Int if n >= 4 then putStrLn "YES" else putStrLn . judge n =<< getLine