const fs = require('fs');

const lines = fs.readFileSync("/dev/stdin", "utf-8").split("\n");
lines.pop();

if (lines[0][2] === lines[0][3] && lines[0][4] === lines[0][5]) {
  console.log("Yes");
} else {
  console.log("No");
}
