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 b < a < c: print("No") elif c < a < b: print("No") else: print("Yes") if __name__ == "__main__": main()