import java.util._
import java.lang._

object Main extends App {
  val sc = new Scanner(System.in)
  var a, b, c = sc.nextInt()
  if ((a < c && c < b) || (b < c && c < a)) {
    println("Yes")
  } else {
    println("No")
  }
}
