import qualified Data.ByteString.Char8 as BS

main = do
  s <- BS.getLine
  let c3 = BS.index s 2
      c4 = BS.index s 3
      c5 = BS.index s 4
      c6 = BS.index s 5
  putStrLn $ if c3 == c4 && c5 == c6
             then "Yes"
             else "No"