route=[0]*4
for _ in range(3):
    a,b=map(int,input().split())
    route[a-1]+=1
    route[b-1]+=1

if route[0]==route[3]==1 and route[1]==route[2]==2:
    print("YES")
else:
    print("NO") route=[0]*4 route [0]*4 [0] 0 4 for _ in range(3):
    a,b=map(int,input().split())
    route[a-1]+=1
    route[b-1]+=1 _ range(3) range 3 a,b=map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b route[a-1]+=1 route[a-1] route a-1 a 1 1 route[b-1]+=1 route[b-1] route b-1 b 1 1 if route[0]==route[3]==1 and route[1]==route[2]==2:
    print("YES")
else:
    print("NO") route[0]==route[3]==1 and route[1]==route[2]==2 route[0]==route[3]==1 route[0]==route[3] route[0] route 0 route[3] route 3 1 route[1]==route[2]==2 route[1]==route[2] route[1] route 1 route[2] route 2 2 print("YES") print "YES" print("NO") print "NO" route=[0]*4 [0]*4 route a,b=map(int,input().split()) map(int,input().split()) a b=map(int,input().split()) map(int,input().split()) b
route=[0]*4
for _ in range(3):
    a,b=map(int,input().split())
    route[a-1]+=1
    route[b-1]+=1

if route[0]==route[3]==1 and route[1]==route[2]==2:
    print("YES")
else:
    print("NO")
