"use strict";

const main = arg => {
    // 標準入力の不要な空白と改行を削除し、配列に格納する
    const input = arg.trim().split(" ");
    const str = input[0];
    const three = str.charAt(2);
    const four = str.charAt(3);
    const five = str.charAt(4);
    const six = str.charAt(5);

    three === four && five === six
        ? console.log('Yes')
        : console.log('No');

}

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