ns = list(map(int, input().split()))
x = 0
for i in ns:
	for j in range(3):
		if ns[j] == i:
			x += 1
o = 'Yes' if x == 5 else 'No'
print(o) ns = list(map(int, input().split())) ns list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split x = 0 x 0 for i in ns:
	for j in range(3):
		if ns[j] == i:
			x += 1 i ns for j in range(3):
		if ns[j] == i:
			x += 1 j range(3) range 3 if ns[j] == i:
			x += 1 ns[j] == i ns[j] ns j i x += 1 x 1 o = 'Yes' if x == 5 else 'No' o 'Yes' if x == 5 else 'No' x == 5 x 5 'Yes' 'No' print(o) print o x = 0 0 x ns = list(map(int, input().split())) list(map(int, input().split())) ns o = 'Yes' if x == 5 else 'No' 'Yes' if x == 5 else 'No' o x += 1 1 x
ns = list(map(int, input().split()))
x = 0
for i in ns:
	for j in range(3):
		if ns[j] == i:
			x += 1
o = 'Yes' if x == 5 else 'No'
print(o)