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