import copy def check(L): if L[0] == L[1] or L[0] == L[2] or L[1] == L[2]: return False if max(L) == L[1] or min(L) == L[1]: return True return False A = list(map(int, input().split())) B = list(map(int, input().split())) if check(A) and check(B): print('Yes') else: yes = False for i in range(3): for j in range(3): C = copy.copy(A) D = copy.copy(B) C[i], D[j] = D[j], C[i] if check(C) and check(D): yes = True break if yes: print('Yes') break else: print('No')