function Main(input) {
	tmp = input.split(" ");
	
	var a = parseInt(tmp[0]);
	var b = parseInt(tmp[1]);
	var c = parseInt(tmp[2]);
	
	if(c>a && c<b || c<a && c>b){
		console.log("Yes");
	}else{
		console.log("No");
	}
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));