A = list(map(int,input().split())) B = list(map(int,input().split())) 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 len(set(A)) == 3 and len(set(B)) == 3: print("Yes") exit() else: A[i] = temp1 B[j] = temp2 print("No")