A=list(map(int,input().split())) B=list(map(int,input().split())) def k(L): if len(set(L))==3 and sorted(L)[1]!=L[1]: return 1 else: return 0 a="No" for i in [0,1,2]: for j in [0,1,2]: X=[x for x in A] Y=[y for y in B] X[i],Y[j]=Y[j],X[i] if k(X)*k(Y)>0:a="Yes" print(a)