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

    if((b > c .and. a < c) .or. (a > c .and. b < c))then
        write(*,*) "Yes"
    else
        write(*,*) "No"
    end if
    stop
end program