function Main(input) {
    input = input.split("\n");
    tmp = input[1].split("");
    if(tmp[2]==tmp[3]){
      	if(tmp[4]==tmp[5]){
			var answer="Yes";
        }else{
			var answer="No";
        }
    }else{
      var answer="No";
    }
    console.log('%d %s',"Yes");
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));