A = list(map(int, input().split())) B = list(map(int, input().split())) def check(X): if len(X) == len(set(X)) and (X[1] == max(X) or X[1] == min(X)): return True else: return False import copy for i in range(3): for j in range(3): X = copy.copy(A) Y = copy.copy(B) X[i], Y[j] = Y[j], X[i] if check(X) and check(Y): print('Yes') exit() print('No')