a=[[int(i) for i in input().split()] for i in range(3)]
import collections 
d=collections.defaultdict(int)
for i in a:
    d[i[0]]+=1
    d[i[1]]+=1
x=[]
for i in d.values():
    x.append(i)
if x.count(1)==2 and x.count(2)==2:
    print("YES")
else:
    print("NO") [int(i) for i in input().split()] for i in range(3) for i in range(3) i range(3) range 3 for i in range(3) [int(i) for i in input().split()] a=[[int(i) for i in input().split()] for i in range(3)] a [[int(i) for i in input().split()] for i in range(3)] import collections collections d=collections.defaultdict(int) d collections.defaultdict(int) collections.defaultdict collections defaultdict int for i in a:
    d[i[0]]+=1
    d[i[1]]+=1 i a d[i[0]]+=1 d[i[0]] d i[0] i 0 1 d[i[1]]+=1 d[i[1]] d i[1] i 1 1 x=[] x [] for i in d.values():
    x.append(i) i d.values() d.values d values x.append(i) x.append x append i if x.count(1)==2 and x.count(2)==2:
    print("YES")
else:
    print("NO") x.count(1)==2 and x.count(2)==2 x.count(1)==2 x.count(1) x.count x count 1 2 x.count(2)==2 x.count(2) x.count x count 2 2 print("YES") print "YES" print("NO") print "NO" d=collections.defaultdict(int) collections.defaultdict(int) d x=[] [] x a=[[int(i) for i in input().split()] for i in range(3)] [[int(i) for i in input().split()] for i in range(3)] a
a=[[int(i) for i in input().split()] for i in range(3)]
import collections 
d=collections.defaultdict(int)
for i in a:
    d[i[0]]+=1
    d[i[1]]+=1
x=[]
for i in d.values():
    x.append(i)
if x.count(1)==2 and x.count(2)==2:
    print("YES")
else:
    print("NO")