def check(A): a, b, c = A if a == b or b == c or c == a: return False if b > c and b > a: return True if b < c and b < a: return True return False A = list(map(int, input().split())) B = list(map(int, input().split())) for i in range(3): for j in range(3): AA = A[::] BB = B[::] AA[i], BB[j] = BB[j], AA[i] if check(AA) and check(BB): print("Yes") exit() print("No")