function Main (input) {
  var i = input.split("\n")[0].split("");
  if (i[2] == i[3] && i[4] == i[5]) {
    console.log("Yes");
  }
  else {
    console.log("No");
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));