const input = require("fs").readFileSync("/dev/stdin", "utf8")

;(input => {

    const lines = input.split('\n')
    const S = lines[0]

    if (S[2] === S[3] && S[4] === S[5]) {
        console.log('Yes')
    } else {
        console.log('No')
    }

})(input)
