path=[list(map(int,input().split())) for i in range(0,3)]

cnt=[0,0,0,0]

for i in range(0,3):
    for j in range(0,2):
        cnt[path[i][j]-1]+=1

if cnt[0]<3 and cnt[1]<3 and cnt[2]<3 and cnt[3]<3:
    print("YES")
else:
    print("NO") list(map(int,input().split())) for i in range(0,3) for i in range(0,3) i range(0,3) range 0 3 for i in range(0,3) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split path=[list(map(int,input().split())) for i in range(0,3)] path [list(map(int,input().split())) for i in range(0,3)] cnt=[0,0,0,0] cnt [0,0,0,0] 0 0 0 0 for i in range(0,3):
    for j in range(0,2):
        cnt[path[i][j]-1]+=1 i range(0,3) range 0 3 for j in range(0,2):
        cnt[path[i][j]-1]+=1 j range(0,2) range 0 2 cnt[path[i][j]-1]+=1 cnt[path[i][j]-1] cnt path[i][j]-1 path[i][j] [i] path i j 1 1 if cnt[0]<3 and cnt[1]<3 and cnt[2]<3 and cnt[3]<3:
    print("YES")
else:
    print("NO") cnt[0]<3 and cnt[1]<3 and cnt[2]<3 and cnt[3]<3 cnt[0]<3 and cnt[1]<3 and cnt[2]<3 cnt[0]<3 and cnt[1]<3 cnt[0]<3 cnt[0] cnt 0 3 cnt[1]<3 cnt[1] cnt 1 3 cnt[2]<3 cnt[2] cnt 2 3 cnt[3]<3 cnt[3] cnt 3 3 print("YES") print "YES" print("NO") print "NO" path=[list(map(int,input().split())) for i in range(0,3)] [list(map(int,input().split())) for i in range(0,3)] path cnt=[0,0,0,0] [0,0,0,0] cnt
path=[list(map(int,input().split())) for i in range(0,3)]

cnt=[0,0,0,0]

for i in range(0,3):
    for j in range(0,2):
        cnt[path[i][j]-1]+=1

if cnt[0]<3 and cnt[1]<3 and cnt[2]<3 and cnt[3]<3:
    print("YES")
else:
    print("NO")