There are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print `Yes` if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print `No` otherwise.
a,b,c=map(int,input().split())
if(a<b and b<c):
		print('Yes')
else:
		print('No')		
a,b,c=map(int,input().split())
if((a<c and c<b) or (b<c and c<a)):
		print('Yes')
else:
		print('No')		