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.
li = list(map(int, input().split()))
A = li[0]
B = li[1]
C = li[2]

if A < B < C or A > B > C:
  print("Yes")
  
else:
  print("No")
li = list(map(int, input().split()))
A = li[0]
B = li[1]
C = li[2]
 
if A < C < B or A > C > B:
  print("Yes")
  
else:
  print("No")