object Main extends App {
  for(line <- io.Source.stdin.getLines()) {
    val numAry = line.split(' ').map { _.toString() }
    val coffee = numAry(0)
    println(if ((coffee.length == 6) && (coffee(2) == coffee(3)) && (coffee(4) == coffee(5))) "Yes" else "No");
  }
}
