import scala.io.StdIn


object Main extends App {

  val Array(a, b, c)  = StdIn.readLine().split(" ").map(_.toInt)

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

  println(solve(a, b, c))
}
  


