program ontheway
    implicit none
    integer :: a,b,c
    read(*,*)a,b,c
    if((c<a .and. c>b) .or. (c<b .and. c>a)) then
        write(*,*)'Yes'
    else
        write(*,*)'No'
    end if
end program ontheway