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