def is_kadomatsu(A): return len(set(A)) == 3 and (max(A) == A[1] or min(A) == A[1]) *A, = map(int, input().split()) *B, = map(int, input().split()) for i in range(3): for j in range(3): A[i], B[i] = B[i], A[i] if is_kadomatsu(A) and is_kadomatsu(B): print("Yes") quit() A[i], B[i] = B[i], A[i] print("No")