alst = list(map(int, input().split())) blst = list(map(int, input().split())) def ok(lst): return len(set(lst)) == 3 and lst[1] in (min(lst), max(lst)) for i in range(3): for j in range(3): clst = alst.copy() dlst = blst.copy() clst[i], dlst[j] = dlst[j], clst[i] if ok(clst) and ok(dlst): print("Yes") exit() print("No")