object A extends App {
  val inputs: Seq[String] = io.Source.stdin.getLines().toList
  val nums = inputs.head.split(" ").map(_.toInt)

  println(solve(nums))

  def solve(nums: Seq[Int]): String = {
    val a = nums(0)
    val b = nums(1)
    val c = nums(2)

    if (a < c && c < b) {
      "Yes"
    } else if (b < c && c < a) {
      "Yes"
    } else {
      "No"
    }
  }
}
