program prob
  implicit none
  integer :: a,b,c
  
  read(*,*) a, b, c

  if ( a < c .and. c < b ) then
     write(*,'(a)') 'Yes'
  else if ( b < c .and. c < a ) then
     write(*,'(a)') 'Yes'
  else
     write(*,'(a)') 'No'
  end if
  
  stop
end program prob
