PROGRAM ATCODER

implicit none
integer :: a,b,c

read*, a,b,c

if ( a<b ) then
  if ( c>=a .and. c<=b ) then
    print'(a)', 'Yes'
  else
    print'(a)', 'No'
  end if
else
  if ( c>=b .and. c<=a ) then
    print'(a)', 'Yes'
  else
    print'(a)', 'No'
end if

END PROGRAM ATCODER