(* 文字列をcharのlistにする *)
let explode s = List.init (String.length s) (String.get s)
let s = read_line () |> explode
let _ = (
  if List.nth s 2 = List.nth s 3 && List.nth s 4 = List.nth s 5 then "Yes" else "No") |> print_endline