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