read a b c
read d e f
read g h i
read n
for((j=0;j<n;j++));do
	read x
	[ $a -eq $x ]&&a=0
	[ $b -eq $x ]&&b=0
	[ $c -eq $x ]&&c=0
	[ $d -eq $x ]&&d=0
	[ $e -eq $x ]&&e=0
	[ $f -eq $x ]&&f=0
	[ $g -eq $x ]&&g=0
	[ $h -eq $x ]&&h=0
	[ $i -eq $x ]&&i=0
done
if [ $[(a+b+c)*(d+e+f)*(g+h+i)*(a+d+g)*(b+e+h)*(c+f+i)*(a+e+i)*(c+e+g)] -eq 0 ];then
	echo Yes
else
	echo No
fi
