import java.util._

object Main {
  def main(args: Array[String]) = {
    val scanner = new Scanner(System.in)
    val string = scanner.nextLine
    if (string(2) != string(3) || string(4) != string(5)) {
      println("No")
    } else {
      println("Yes")
    }
  }
}
