import java.util.Scanner
import scala.math._

object Main extends App {

  val sc = new Scanner(System.in)
  val S = sc.next()

  if(S(2)==S(3)&&S(4)==S(5)){
    println("Yes")
  }else println("No")

}

