road = []

road += input().split()
road += input().split()
road += input().split()

from collections import Counter

c = Counter(road)

flag = True
for k, v in c.items():
    if v > 2:
        flag = False

if flag:
    print("YES")
else:
    print("NO") road = [] road [] road += input().split() road input().split() ().split () input split road += input().split() road input().split() ().split () input split road += input().split() road input().split() ().split () input split from collections import Counter c = Counter(road) c Counter(road) Counter road flag = True flag True for k, v in c.items():
    if v > 2:
        flag = False k v c.items() c.items c items if v > 2:
        flag = False v > 2 v 2 flag = False flag False if flag:
    print("YES")
else:
    print("NO") flag print("YES") print "YES" print("NO") print "NO" flag = False False flag c = Counter(road) Counter(road) c road += input().split() input().split() road road = [] [] road road += input().split() input().split() road flag = True True flag road += input().split() input().split() road
road = []

road += input().split()
road += input().split()
road += input().split()

from collections import Counter

c = Counter(road)

flag = True
for k, v in c.items():
    if v > 2:
        flag = False

if flag:
    print("YES")
else:
    print("NO")
