def calc(a, b): return (len(set(a)) > 2 and a[1] in (min(a), max(a))) and (len(set(b)) > 2 and b[1] in (min(b), max(b))) a = list(map(int, input().strip().split(' '))) b = list(map(int, input().strip().split(' '))) for i in range(3): for j in range(3): aa = [b[j] if k == i else a[k] for k in range(3)] bb = [a[i] if k == j else b[k] for k in range(3)] if calc(aa, bb) == True: print('Yes') exit(0) print('No')