program main
  
  implicit none
  character(6) :: s
  
  read(*,*) s
  
  if( s(3:3) == s(4:4) ) then  
    if( s(5:5) == s(6:6) ) then  
      print*, "Yes"
    endif
  else
    print*, "No"
  endif
end program main
