program main
 implicit none

 integer A,B,C
 read(*,*) A,B,C
 if(A < C .and. B > C) then
  write(*,*) 'Yes'
 else if(A > C .and. B < C) then
  write(*,*) 'Yes'
 else
  write(*,*) 'No'
 end if
end program main