import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val s = sc.next()

  println(abc160a(s))
}

private fun abc160a(s: String): String {
  val s3 = s.get(2)
  val s4 = s.get(3)
  val s5 = s.get(4)
  val s6 = s.get(5)

  if (s3 == s4 && s5 == s6) return "Yes"
  return "No"
}
