There are three houses on a number line: House 1, 2 and 3, with coordinates A, B and C, respectively. Print `Yes` if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print `No` otherwise.
a,b,c=map(int,input().split())
if a<=c:
    if b<=c:
        print('Yes')
    else:
        print('No')
else:
    print('No')

a,b,c=map(int,input().split())
z=0

if a<b:
    if a<c:
        if b>c:
            z=1
else:
    if a>c:
        if b<c:
            z=1

if z==1:
    print('Yes')
else:
    print('No')

