N = int(input()) A, B, C = map(int, input().split()) d = [A, B, C] d.sort() if A == C or B == C or d[1] == A: exit(print("No")) print("Yes")