G = [list(map(int,input().split())) for i in range(3)]
deg = [0]*4
for x in G:
    deg[x[0]-1] += 1
    deg[x[1]-1] += 1
odd = 0
for x in deg:
    if x%2 == 1:
        odd += 1
if odd == 0 or odd ==2:
    print("YES")
else:
    print("NO") list(map(int,input().split())) for i in range(3) for i in range(3) i range(3) range 3 for i in range(3) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split G = [list(map(int,input().split())) for i in range(3)] G [list(map(int,input().split())) for i in range(3)] deg = [0]*4 deg [0]*4 [0] 0 4 for x in G:
    deg[x[0]-1] += 1
    deg[x[1]-1] += 1 x G deg[x[0]-1] += 1 deg[x[0]-1] deg x[0]-1 x[0] x 0 1 1 deg[x[1]-1] += 1 deg[x[1]-1] deg x[1]-1 x[1] x 1 1 1 odd = 0 odd 0 for x in deg:
    if x%2 == 1:
        odd += 1 x deg if x%2 == 1:
        odd += 1 x%2 == 1 x%2 x 2 1 odd += 1 odd 1 if odd == 0 or odd ==2:
    print("YES")
else:
    print("NO") odd == 0 or odd ==2 odd == 0 odd 0 odd ==2 odd 2 print("YES") print "YES" print("NO") print "NO" odd = 0 0 odd deg = [0]*4 [0]*4 deg G = [list(map(int,input().split())) for i in range(3)] [list(map(int,input().split())) for i in range(3)] G odd += 1 1 odd
G = [list(map(int,input().split())) for i in range(3)]
deg = [0]*4
for x in G:
    deg[x[0]-1] += 1
    deg[x[1]-1] += 1
odd = 0
for x in deg:
    if x%2 == 1:
        odd += 1
if odd == 0 or odd ==2:
    print("YES")
else:
    print("NO")