main :: IO()
main = do
    n <- getLine 
    putStrLn $ if isCoffee n then "Yes" else "No"

isCoffee :: String -> Bool
isCoffee s =
    let
        c3 = s !! 2 
        c4 = s !! 3
        c5 = s !! 4
        c6 = s !! 5 
    in
    c3 == c4 && c5 == c6

