z = input a,b,c = map(int,input().split()) if min([a,b]) <= c <= max([a,b]) or c <=max([a,b]): print("No") else: print("Yes")