ab=[list(map(int,input().split())) for i in range(3)]
cnt=[0,0,0,0]
ans='YES'
for i in ab:
    for j in i:
        cnt[j-1]+=1
for i in cnt:
    if i>=3:
        ans='NO'
print(ans) 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 ab=[list(map(int,input().split())) for i in range(3)] ab [list(map(int,input().split())) for i in range(3)] cnt=[0,0,0,0] cnt [0,0,0,0] 0 0 0 0 ans='YES' ans 'YES' for i in ab:
    for j in i:
        cnt[j-1]+=1 i ab for j in i:
        cnt[j-1]+=1 j i cnt[j-1]+=1 cnt[j-1] cnt j-1 j 1 1 for i in cnt:
    if i>=3:
        ans='NO' i cnt if i>=3:
        ans='NO' i>=3 i 3 ans='NO' ans 'NO' print(ans) print ans ans='NO' 'NO' ans cnt=[0,0,0,0] [0,0,0,0] cnt ans='YES' 'YES' ans ab=[list(map(int,input().split())) for i in range(3)] [list(map(int,input().split())) for i in range(3)] ab
ab=[list(map(int,input().split())) for i in range(3)]
cnt=[0,0,0,0]
ans='YES'
for i in ab:
    for j in i:
        cnt[j-1]+=1
for i in cnt:
    if i>=3:
        ans='NO'
print(ans)