# -*- coding: utf-8 -*-
a = []
for i in range(3):
  tmp = input()
  a.append(list(map(int, tmp.split())))

n = int(input())
b = []
for j in range(n):
    b.append(int(input()))

# print(a)
# print(b)

for i in range(3):
    for j in range(3):
        if a[i][j] in b:
           a[i][j] = 0
# print(a)

def check(a):
    #　たてビンゴ
    for i in range(3):
        if (a[i][0] == 0 & a[i][1] == 0 & a[i][2] == 0):
            print('Yes')
            exit()
    # 横ビンゴ
        if a[i] == [0, 0, 0]:
            print('Yes')
            exit()
    # 斜めビンゴ
    if a[0][0] == 0 & a[1][1] == 0 & a[2][2] == 0:
            print('Yes')
            exit()
    if a[0][2] == 0 & a[1][1] == 0 & a[2][0] == 0:
            print('Yes')
            exit()
    print('No')

check(a)