a=[0]*4
for i in range(3):
	x,y=map(int,input().split())
	a[x-1]+=1
	a[y-1]+=1
c=0
for i in range(4):
	if a[i]%2!=0:
		c+=1
if c==0 or c==2:
	print("YES")
else:
	print("NO") a=[0]*4 a [0]*4 [0] 0 4 for i in range(3):
	x,y=map(int,input().split())
	a[x-1]+=1
	a[y-1]+=1 i range(3) range 3 x,y=map(int,input().split()) x map(int,input().split()) map int input().split() ().split () input split y a[x-1]+=1 a[x-1] a x-1 x 1 1 a[y-1]+=1 a[y-1] a y-1 y 1 1 c=0 c 0 for i in range(4):
	if a[i]%2!=0:
		c+=1 i range(4) range 4 if a[i]%2!=0:
		c+=1 a[i]%2!=0 a[i]%2 a[i] a i 2 0 c+=1 c 1 if c==0 or c==2:
	print("YES")
else:
	print("NO") c==0 or c==2 c==0 c 0 c==2 c 2 print("YES") print "YES" print("NO") print "NO" a=[0]*4 [0]*4 a c+=1 1 c y=map(int,input().split()) map(int,input().split()) y c=0 0 c x,y=map(int,input().split()) map(int,input().split()) x
a=[0]*4
for i in range(3):
	x,y=map(int,input().split())
	a[x-1]+=1
	a[y-1]+=1
c=0
for i in range(4):
	if a[i]%2!=0:
		c+=1
if c==0 or c==2:
	print("YES")
else:
	print("NO")