"use strict";
function main(input) {
  let kari = input[0];

  let result = kari.split("");

  console.log((result[2]===result[3]&&result[4]===result[5])?"Yes":"No");

}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));