import sys


def MI():
    return map(int, sys.stdin.readline().rstrip().split())


A, B, C = MI()
print('Yes' if A < C < B or B < C < A else 'No')

d7200d1ebcbb0a35acd35ce80940f92821365982
<mask token>


def MI():
    return map(int, sys.stdin.readline().rstrip().split())


<mask token>

<mask token>


def MI():
    return map(int, sys.stdin.readline().rstrip().split())


<mask token>
print('Yes' if A < C < B or B < C < A else 'No')

<mask token>


def MI():
    return map(int, sys.stdin.readline().rstrip().split())


A, B, C = MI()
print('Yes' if A < C < B or B < C < A else 'No')

import sys


def MI():
    return map(int, sys.stdin.readline().rstrip().split())


A, B, C = MI()
print('Yes' if A < C < B or B < C < A else 'No')
