(* mod *)
(*
let internal moda = 1

let internal ( +% ) x y = 
  ((x + y) % moda)
let internal ( *% ) x y = 
  ((x * y) % moda)

let internal ( ^% ) x y = 
  let rec loop x y result =
    match y with
    | 0L -> result
    | _ -> 
      loop x (y - 1L) ((result * x) % moda)
  loop x y 1L
*)

(* Standard Input *)
let readSplit elementFun=
  stdin.ReadLine().Split()
  |> Array.map elementFun

let read elementFun =
  stdin.ReadLine() |> elementFun

let readMap H =
  [|for i in 1..H -> stdin.ReadLine()|]
  |> Array.map(fun line ->
    line.ToCharArray()
  )
  |> array2D

(* Main *)
let S = (read id).ToCharArray()
if S.[2] = S.[3] && S.[4] = S.[5] then "Yes" else "No"
|> printfn "%s"
