def kadomatsu(X):
    a, b, c = X
    if a == b or b == c or c == a:
        return False
    if a < b < c or a > b > c:
        return False
    return True

A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(3):
    for j in range(3):
        A[i], B[j] = B[j], A[i]
        if kadomatsu(A) and kadomatsu(B):
            print("Yes")
            exit()
        A[i], B[j] = B[j], A[i]
        
print("No")