def kadomatsu(aa): a, b, c = aa[0], aa[1], aa[2] res = True if a == b or b == c or c == a: res = False if b != max(a, b, c) and b != min(a, b, c): res = False return res a = list(map(int, input().split())) b = list(map(int, input().split())) flg = 1 for i in range(3): for j in range(3): a[i], b[j] = b[j], a[i] if kadomatsu(a) and kadomatsu(b): flg = 0 a[i], b[j] = b[j], a[i] print(["Yes", "No"][flg])