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