module Main where


main :: IO ()
main = do
        a      <- getLine
        let char6 = last a
        let char5 = last (init a)
        let char4 = last (init (init a)) 
        let char3 = last (init (init (init a))) 
        putStrLn (if ( char3 == char4 && char5 == char6) then "Yes" else "No")

