A = list(map(int,input().split())) B = list(map(int,input().split())) if sorted(A) == sorted(B): print("No") exit() for a in A: if B.count(a) > 1: print("No") exit() for b in B: if A.count(B) > 1: print("No") exit() print("Yes")