n = int(input()) a, b, c = map(int, input().split()) if a < b: if a < c: print("Yes") else: print("No") else: if a > c: print("Yes") else: print("No")