G = [[] for _ in range(4)]
for _ in range(3):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    G[a].append(b)
    G[b].append(a)

num = []
for i in range(4):
    num.append(len(G[i]))

cnt = num.count(1)
if cnt < 3:
    print('YES')
else:
    print('NO') [] for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) [] G = [[] for _ in range(4)] G [[] for _ in range(4)] for _ in range(3):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    G[a].append(b)
    G[b].append(a) _ range(3) range 3 a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b a, b = a - 1, b - 1 a a - 1 a 1 b b - 1 b 1 G[a].append(b) [a].append [a] G a append b G[b].append(a) [b].append [b] G b append a num = [] num [] for i in range(4):
    num.append(len(G[i])) i range(4) range 4 num.append(len(G[i])) num.append num append len(G[i]) len G[i] G i cnt = num.count(1) cnt num.count(1) num.count num count 1 if cnt < 3:
    print('YES')
else:
    print('NO') cnt < 3 cnt 3 print('YES') print 'YES' print('NO') print 'NO' G = [[] for _ in range(4)] [[] for _ in range(4)] G a, b = a - 1, b - 1 a - 1 a num = [] [] num a, b = map(int, input().split()) map(int, input().split()) a cnt = num.count(1) num.count(1) cnt b = map(int, input().split()) map(int, input().split()) b b = a - 1, b - 1 b - 1 b
G = [[] for _ in range(4)]
for _ in range(3):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1
    G[a].append(b)
    G[b].append(a)

num = []
for i in range(4):
    num.append(len(G[i]))

cnt = num.count(1)
if cnt < 3:
    print('YES')
else:
    print('NO')