process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
  const a = lines[0].split(" ")[0];
  const b = lines[0].split(" ")[1];
  const c = lines[0].split(" ")[2];
  
  a < c && c < b || b < c && c < a ? console.log("Yes") : console.log("No")
});