"use strict";
function Main(input) {
    let cin = new Inputer(input);
    let A = cin.getInt(), B = cin.getInt(), C = cin.getInt();
    let ans = (A < C && C < B) || (B < C && C < A);
    console.log(ans ? "Yes" : "No");
}
class Inputer{constructor(t){this.cnt=0,this.items=t.split(/\n|\s/)}getInt(){return this.items[this.cnt++]-0}getIntArray(t){let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getInt();return r}getStr(){return this.items[this.cnt++]}getStrArray(t){let r=new Array(t);for(let e=0;e<t;e++)r[e]=this.getStr();return r}}
if (typeof window == "undefined") Main(require("fs").readFileSync("/dev/stdin", "utf8"));