a1, a2 = map(int, input().split())
a3, a4 = map(int, input().split())
a5, a6 = map(int, input().split())

ans = []

ans.append(a1)
ans.append(a2)
ans.append(a3)
ans.append(a4)
ans.append(a5)
ans.append(a6)

max = 0

for i in ans:
	if max < ans.count(i):
		max = ans.count(i)

print("YES" if max <= 2 else "NO") a1, a2 = map(int, input().split()) a1 map(int, input().split()) map int input().split() ().split () input split a2 a3, a4 = map(int, input().split()) a3 map(int, input().split()) map int input().split() ().split () input split a4 a5, a6 = map(int, input().split()) a5 map(int, input().split()) map int input().split() ().split () input split a6 ans = [] ans [] ans.append(a1) ans.append ans append a1 ans.append(a2) ans.append ans append a2 ans.append(a3) ans.append ans append a3 ans.append(a4) ans.append ans append a4 ans.append(a5) ans.append ans append a5 ans.append(a6) ans.append ans append a6 max = 0 max 0 for i in ans:
	if max < ans.count(i):
		max = ans.count(i) i ans if max < ans.count(i):
		max = ans.count(i) max < ans.count(i) max ans.count(i) ans.count ans count i max = ans.count(i) max ans.count(i) ans.count ans count i print("YES" if max <= 2 else "NO") print "YES" if max <= 2 else "NO" max <= 2 max 2 "YES" "NO" max = 0 0 max a2 = map(int, input().split()) map(int, input().split()) a2 max = ans.count(i) ans.count(i) max a4 = map(int, input().split()) map(int, input().split()) a4 a1, a2 = map(int, input().split()) map(int, input().split()) a1 a5, a6 = map(int, input().split()) map(int, input().split()) a5 ans = [] [] ans a6 = map(int, input().split()) map(int, input().split()) a6 a3, a4 = map(int, input().split()) map(int, input().split()) a3
a1, a2 = map(int, input().split())
a3, a4 = map(int, input().split())
a5, a6 = map(int, input().split())

ans = []

ans.append(a1)
ans.append(a2)
ans.append(a3)
ans.append(a4)
ans.append(a5)
ans.append(a6)

max = 0

for i in ans:
	if max < ans.count(i):
		max = ans.count(i)

print("YES" if max <= 2 else "NO")