program main
    implicit none
    integer i, flag
    character s*6
    read(*,*) s

    flag = 0
    if (s(3:3) == s(4:4)) then
        flag = 0
    else 
        flag = 1
    end if

    if (flag == 1) then
        if(s(5:5) == s(6:6)) then
            flag = 0
        else 
            flag = 1
        end if
    end if

    if (flag == 0) then
        write(*,*) "Yes"
    else if (flag == 1) then
        write(*,*) "No"
    end if

end program