import           Data.Maybe                     ( fromMaybe )

mSimilarWithCoffee :: String -> Maybe Bool
mSimilarWithCoffee (_ : _ : c3 : c4 : c5 : c6 : _) =
    Just $ c3 == c4 && c5 == c6
mSimilarWithCoffee _ = Nothing


main = do
    s <- getLine
    let result = fromMaybe False $ mSimilarWithCoffee s
    case result of
        True  -> putStrLn "Yes"
        False -> putStrLn "No"
