#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: print('Yes') else: print('No')