A = list(map(int, input().split())) B = list(map(int, input().split())) def isKadomatsu(A): a, b, c = A if a == b or a == c or b == c: return False if b == min(a, b, c): return True if b == max(a, b, c): return True return False def isOK(X, Y): return isKadomatsu(X) and isKadomatsu(Y) ans = False for i in range(3): for j in range(3): A[i], B[j] = B[j], A[i] ans |= isOK(A, B) A[i], B[j] = B[j], A[i] if ans: print("Yes") else: print("No")