import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val S = sc.nextLine

  def yesOrNo(boolean: Boolean): String =
    if (boolean) "Yes" else "No"

  println(yesOrNo(S(2) == S(3) && S(4) == S(5)))
}
