city={1:0, 2:0, 3:0, 4:0}
for _ in range(3):
    a,b=map(int, input().split())
    city[a]+=1
    city[b]+=1
    
if list(city.values()).count(2)==2:
    print("YES")
else:
    print("NO") city={1:0, 2:0, 3:0, 4:0} city {1:0, 2:0, 3:0, 4:0} 1 1 0 2 2 0 3 3 0 4 4 0 for _ in range(3):
    a,b=map(int, input().split())
    city[a]+=1
    city[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 city[a]+=1 city[a] city a 1 city[b]+=1 city[b] city b 1 if list(city.values()).count(2)==2:
    print("YES")
else:
    print("NO") list(city.values()).count(2)==2 list(city.values()).count(2) (city.values()).count (city.values()) list city.values() city.values city values count 2 2 print("YES") print "YES" print("NO") print "NO" a,b=map(int, input().split()) map(int, input().split()) a b=map(int, input().split()) map(int, input().split()) b city={1:0, 2:0, 3:0, 4:0} {1:0, 2:0, 3:0, 4:0} city
city={1:0, 2:0, 3:0, 4:0}
for _ in range(3):
    a,b=map(int, input().split())
    city[a]+=1
    city[b]+=1
    
if list(city.values()).count(2)==2:
    print("YES")
else:
    print("NO")