def check(A): if (A[1]-A[0])*(A[2]-A[1])>0: return True return False 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())