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', () => {
	"use strict"
	const ABC = lines[0].split(" ").map(Number);
	const A = ABC[0];
	const B = ABC[1];
	const C = ABC[2];
	
	console.log((A<C&&C<B)||(A>C&&C>B) ? "Yes":"No");
});