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 < B) or (B < C < A ):
    print("YES")
else:
    print("NO")
A, B, C = map(int,input().split())

if (A < C < B) or (B < C < A ):
    print("Yes")
else:
    print("No")