isSimilarWithCoffee :: String -> Maybe Bool
isSimilarWithCoffee str =
    Just
        $  safelyPickChar 2 str
        == safelyPickChar 3 str
        && safelyPickChar 4 str
        == safelyPickChar 5 str

safelyPickChar :: Int -> String -> Maybe Char
safelyPickChar x str | x < 0          = Nothing
                     | length str < x = Nothing
                     | otherwise      = Just $ str !! x

main = do
    s <- getLine
    case isSimilarWithCoffee s of
        Nothing   -> putStrLn "Yes"
        Just bool -> case bool of
            True  -> putStrLn "Yes"
            False -> putStrLn "No"

