a1, b1 = map(int, input().split())
a2, b2 = map(int, input().split())
a3, b3 = map(int, input().split())

route_lists = [a1, b1, a2, b2, a3, b3]
cnt_lists = []

for i in range(1, 5, 1):
    cnt = route_lists.count(i)
    cnt_lists.append(cnt)

if 3 in cnt_lists:
    ans = 'NO'
else:
    ans = 'YES'

print(ans) a1, b1 = map(int, input().split()) a1 map(int, input().split()) map int input().split() ().split () input split b1 a2, b2 = map(int, input().split()) a2 map(int, input().split()) map int input().split() ().split () input split b2 a3, b3 = map(int, input().split()) a3 map(int, input().split()) map int input().split() ().split () input split b3 route_lists = [a1, b1, a2, b2, a3, b3] route_lists [a1, b1, a2, b2, a3, b3] a1 b1 a2 b2 a3 b3 cnt_lists = [] cnt_lists [] for i in range(1, 5, 1):
    cnt = route_lists.count(i)
    cnt_lists.append(cnt) i range(1, 5, 1) range 1 5 1 cnt = route_lists.count(i) cnt route_lists.count(i) route_lists.count route_lists count i cnt_lists.append(cnt) cnt_lists.append cnt_lists append cnt if 3 in cnt_lists:
    ans = 'NO'
else:
    ans = 'YES' 3 in cnt_lists 3 cnt_lists ans = 'NO' ans 'NO' ans = 'YES' ans 'YES' print(ans) print ans b2 = map(int, input().split()) map(int, input().split()) b2 b3 = map(int, input().split()) map(int, input().split()) b3 cnt_lists = [] [] cnt_lists b1 = map(int, input().split()) map(int, input().split()) b1 cnt = route_lists.count(i) route_lists.count(i) cnt a2, b2 = map(int, input().split()) map(int, input().split()) a2 ans = 'NO' 'NO' ans a1, b1 = map(int, input().split()) map(int, input().split()) a1 ans = 'YES' 'YES' ans a3, b3 = map(int, input().split()) map(int, input().split()) a3 route_lists = [a1, b1, a2, b2, a3, b3] [a1, b1, a2, b2, a3, b3] route_lists
a1, b1 = map(int, input().split())
a2, b2 = map(int, input().split())
a3, b3 = map(int, input().split())

route_lists = [a1, b1, a2, b2, a3, b3]
cnt_lists = []

for i in range(1, 5, 1):
    cnt = route_lists.count(i)
    cnt_lists.append(cnt)

if 3 in cnt_lists:
    ans = 'NO'
else:
    ans = 'YES'

print(ans)