import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val A, B, C = Integer.parseInt(sc.next())

    println(solve(A,B,C))
  }

  def solve(A: Int, B: Int, C: Int): String = {
    if ((A > C & C > B) | (A < C & C < B)) {
      "Yes"
    } else {
      "No"
    }
  }
}