function Main(input) {
  var args = input.split(' ');
  var a = parseInt(args.shift());
  var b = parseInt(args.shift());
  var c = parseInt(args.shift());
  console.log((a <= c && c <= b) || (b <= c && c <= a) ? 'Yes' : 'No');
}

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