program main
  
  implicit none
  character(6) :: s
  integer :: n
  
  read(*,*) s
  n = 0 
  if( s(3:3) == s(4:4) ) n = n + 1
  if( s(5:5) == s(6:6) ) n = n + 1
 
  if( n == 2 ) then
     print*, "Yes"
  else
     print*, "No"
  end if
end program main
