#????????????????????????????????????????????????????? import sys from copy import copy a=list(map(int,input().split())) b=list(map(int,input().split())) if a==b: print("No") sys.exit() for i in range(3): for j in range(3): A=copy(a) B=copy(b) A[i],B[j]=B[j],A[i] if A[1] in [max(A),min(A)] and A[1]!=A[0] and A[1]!=A[2] and B[1] in [max(B),min(B)] and B[1]!=B[0] and B[1]!=B[2]: print("Yes") sys.exit() print("No")