import functools import sys import typing from typing import Callable, Dict, List, Set, Tuple sys.setrecursionlimit(10 ** 6) sinput: Callable[..., str] = sys.stdin.readline debug = functools.partial(print, file=sys.stderr) MOD: int = 998244353 INF: float = float("Inf") IINF: int = sys.maxsize // 2 def main() -> None: _ = int(input()) a, b, c = map(int, input().split()) if a == c: print("No") elif b == c: print("Yes") elif a < b < c: print("Yes") elif c < b < a: print("Yes") else: print("No") if __name__ == "__main__": main()