program prob1
    implicit none
    integer :: q,w,e
    read(*,*) q,w,e
    if(q <= e .and. e <= w) then
        write(*,*) "Yes"
        stop
    end if
    if(q >= e .and. e >= w) then
        write(*,*) "Yes"
        stop
    end if
    write(*,*) "No"

    stop
contains
end program prob1