import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    //nextLineとnextを同時に使ったら死ぬ
    val sc = new Scanner(System.in)
    val s = sc.next()
    val ans =
      if (s(2) == s(3) && s(4) == s(5)) "Yes" else "No"
    println(ans)
  }
}
