def f(l): s = set(l) if len(s) != 3: return False if (l[0] < l[1] and l[1] > l[2]) or (l[0] > l[1] and l[1] < l[2]): return True else: return False a = list(map(int, input().split())) b = list(map(int, input().split())) for i in range(3): for j in range(3): ac = a[:] bc = b[:] ac[i], bc[j] = bc[j], ac[i] if (f(ac) == True) and (f(bc) == True): print("Yes") exit(0) print("No")