import std.stdio, std.conv, std.string, std.math, std.regex, std.range, std.ascii, std.algorithm;

void main(){
	auto N = readln.split.to!(int[]), A=N[0], B=N[1], C=N[2];
	if((A<C&&C<B)||(B<C&&C<A)){
		writeln("Yes");
	}else{
		writeln("No");
	}
}