function main(input){
    if(input.substr(2,1)==input.substr(3,1)&&input.substr(4,1)==input.substr(5,1)){
        console.log("Yes");
    }else{
        console.log("No");
    }
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));