"use strict"
function main(arg) {
      



       if((arg.trim().split("\n")[0].substring(2,3) == arg.trim().split("\n")[0].substring(3,4)) &&  (arg.trim().split("\n")[0].substring(4,5) == arg.trim().split("\n")[0].substring(5,6)) ){
            console.log('Yes');

       }else{
               console.log('No');
       }


}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));