def check(A): return (A[1]-A[0])*(A[1]-A[2])>0 and len(set(A))==3 def solve(): A = list(map(int, input().split())) B = list(map(int, input().split())) for i in range(3): for j in range(3): C = A[:]; D = B[:] C[i], D[j] = D[j], C[i] if check(C) and check(D): return 'Yes' return 'No' print(solve())