# 2019/11/27

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

odd=0
for c in edge:
    if len(c)%2:odd+=1
print('YES' if odd==2 else 'NO') [] for _ in range(4) for _ in range(4) _ range(4) range 4 for _ in range(4) [] edge=[[] for _ in range(4)] edge [[] for _ in range(4)] for _ in range(3):
    a,b=map(int,input().split())
    a,b=a-1,b-1
    edge[a].append(b)
    edge[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 edge[a].append(b) [a].append [a] edge a append b edge[b].append(a) [b].append [b] edge b append a odd=0 odd 0 for c in edge:
    if len(c)%2:odd+=1 c edge if len(c)%2:od len(c)%2 len(c) len c 2 print('YES' if odd==2 else 'NO') print 'YES' if odd==2 else 'NO' odd==2 odd 2 'YES' 'NO' edge=[[] for _ in range(4)] [[] for _ in range(4)] edge b=a-1,b-1 b-1 b b=map(int,input().split()) map(int,input().split()) b odd=0 0 odd a,b=map(int,input().split()) map(int,input().split()) a a,b=a-1,b-1 a-1 a
# 2019/11/27

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

odd=0
for c in edge:
    if len(c)%2:odd+=1
print('YES' if odd==2 else 'NO')
