a = list(map(int, input().split())) b = list(map(int, input().split())) def check(): for c in a, b: if len(set(c)) != 3 or not (c[1] < min(c[0], c[2]) or c[1] > max(c[0], c[2])): return False return True for i in range(3): for j in range(3): a[i], b[j] = b[j], a[i] if check(): print('Yes') exit() a[i], b[j] = b[j], a[i] print('No') exit()