from collections import defaultdict
dic = defaultdict(int)

for _ in range(3):
    a,b = map(int,input().split())
    dic[a] += 1
    dic[b] += 1

for i in dic.values():
   if i == 3:
       print("NO")
       exit()
print("YES") from collections import defaultdict dic = defaultdict(int) dic defaultdict(int) defaultdict int for _ in range(3):
    a,b = map(int,input().split())
    dic[a] += 1
    dic[b] += 1 _ range(3) range 3 a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b dic[a] += 1 dic[a] dic a 1 dic[b] += 1 dic[b] dic b 1 for i in dic.values():
   if i == 3:
       print("NO")
       exit() i dic.values() dic.values dic values if i == 3:
       print("NO")
       exit() i == 3 i 3 print("NO") print "NO" exit() exit print("YES") print "YES" dic = defaultdict(int) defaultdict(int) dic b = map(int,input().split()) map(int,input().split()) b a,b = map(int,input().split()) map(int,input().split()) a
from collections import defaultdict
dic = defaultdict(int)

for _ in range(3):
    a,b = map(int,input().split())
    dic[a] += 1
    dic[b] += 1

for i in dic.values():
   if i == 3:
       print("NO")
       exit()
print("YES")