a=list(map(int,input().split())) b=list(map(int,input().split())) def ok(x): if x[0]>x[1] and x[2]>x[1] or x[0]<x[1] and x[2]<x[1] and len(set(x))==3: return 1 return 0 for i in range(3): for j in range(3): A=a.copy() B=b.copy() A[i],B[j]=B[j],A[i] if ok(A)==ok(B)==1: print("Yes") exit() print("No")