      PROGRAM piyo
      IMPLICIT NONE
      character(6) :: s
      
      read*,s
      
      if( s(3:3)==s(4:4) .and. s(5:5)==s(6:6) )then
        print*,'Yes'
      else
        print*,'No'
      end if
      
      
      
      
      
      END PROGRAM