#yukicoder No.1829 Möbius Tunnelling N = int(input()) a, b, c = map(int, input().split()) if a < b <= c or c <= b < a or b <= c < a or a < c <= b: print('Yes') else: print('No')