object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val ls = in.head.split(' ').map(_.toInt)
  val A = ls(0)
  val B = ls(1)
  val C = ls(2)
  val ret = if((A<C && C<B)||(B<C && C<A)) "Yes" else "No"
  println(ret)
}
