import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  s <- T.getLine :: IO T.Text
  let
    f :: Int -> Char
    f = T.index s
  putStrLn $ if f 2 == f 3 && f 4 == f 5 then "Yes" else "No"
