import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
let S = split[0]

let A = S.prefix(3)
let B = S.prefix(4)
let C = S.prefix(5)
let D = S.prefix(6)

if (A==B && C==D){
    print("Yes")
}else{
    print("No")
}
