open Printf open Scanf
open Array

let () = scanf " %d %d %d" @@ fun a b c ->
  if a<b then (
    for i=a to b do
      if i=c then (
        printf "Yes"; exit 0
      )
    done;
    printf "No"
  ) else (
    for i=b to a do
      if i=c then (
        printf "Yes"; exit 0
      )
    done;
    printf "No"
  )

