program ABC160A
    implicit none
    character(6)::S
    read*,S
    if(S(3:3)==S(4:4).and.S(5:5)==S(6:6))then
        print'(A)',"Yes"
    else
        print'(A)',"No"
    end if
end program ABC160A