There are four towns, numbered 1,2,3 and 4. Also, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally. No two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.  Determine if we can visit all the towns by traversing each of the roads exactly once.
#coding:utf-8

a0,b0= map(int,input().split())
a1,b1 = map(int,input().split())
a2,b2 = map(int,input().split())

a=[a0,a1,a2,b0,b1,b2]
ans = 0
for i in range(1,5):
	count = 0
	for j in a:
		if i == j:
			count += 1
	if count > 2:
		ans = 1
		
if ans == 1:
	print('YES')
else:
	print('NO')
#coding:utf-8

a0,b0= map(int,input().split())
a1,b1 = map(int,input().split())
a2,b2 = map(int,input().split())

a=[a0,a1,a2,b0,b1,b2]

if a.count(1) > 2:
	print('NO')
elif a.count(2) > 2:
	print('NO')
elif a.count(3) > 2:
	print('NO')
elif  a.count(4) >2:
  print('NO')
else:
	print('YES')