function Main(input) {
  input = input.split("\n");
  var A = parseInt(input[0].split(" ")[0]);
  var B = parseInt(input[0].split(" ")[1]);
  var C = parseInt(input[0].split(" ")[2]);

  if(A <= B){
    if(A <= C && C <= B){
      console.log("Yes");
    }else{
      console.log("No");
    }
  }else{
    if(B <= C && C <= A){
      console.log("Yes");
    }else{
      console.log("No");
    }
  }
}

var input=Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// var input=`3 8 5`
// Main(input);
