A = list(map(int,input().split())) B = list(map(int,input().split())) ans = "No" for i in range(3): for j in range(3): if i <= j: temp1,temp2 = A[i],B[j] A[i] = temp2 B[j] = temp1 if (A[1] == max(A) or A[1] == min(A)) and (B[1] == max(B) or B[1] == min(B)) and A.count(A[1]) == 1 and B.count(B[1]) == 1: ans = "Yes" break else: A[i] = temp1 B[j] = temp2 print(ans)