from collections import defaultdict import sys readline=sys.stdin.readline write=sys.stdout.write import itertools N=int(readline()) a,b,c=map(int,readline().split()) if (b-a)*(c-a)>0: ans="Yes" else: ans="No" print(ans)