program prob49
    implicit none
    character(6) :: s
    read(*,*) s
    if(s(3:3) == s(4:4) .and. s(5:5) == s(6:6)) then
        write(*,*) "Yes"
    else
        write(*,*) "No"
    end if
    stop
contains
end program prob49