A = list(map(int,input().split())) B = list(map(int,input().split())) 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 (min(a) == a[1] or max(a) == a[1]) and (min(b) == b[1] or max(b) == b[1]): print("Yes") exit() print("No")