"use strict"
function Main(stdin){
stdin = stdin.trim().split("\n").reverse();
let stdout = [];
function input(){return stdin.pop()};
function print(x){stdout.push(x)};
function mapint(x){return x.map(n=>parseInt(n))};
function mapfloat(x){return x.map(n=>parseFloat(n))};
function max(x){return x.reduce(function(a,b){ return Math.max(a,b) }) }
function min(x){return x.reduce(function(a,b){ return Math.min(a,b) }) }
function sum(x){return x.reduce(function(a,b){ return a+b }) }
function sorting(x, index){x.sort((a, b) => a[index] - b[index])}
function all(x){return x.reduce(function(a,b){ return a && b }) }
function any(x){return x.reduce(function(a,b){ return a || b }) }
function inlist(x, xs){return xs.includes(x)}
function inset(x, xs){return xs.has(x)}
function list(iterable){return Array.from(iterable)}
function arrayint(iterable){return Array.from(iterable, x => parseInt(x))}
function tile(val, len){return Array(len).fill(val)}
for (let i = 0; i < 10; i++){ break; }
const range = (start, stop, step) => Array.from(
    { length: (stop - start) / step }, (_, i) => start + (i * step));
/*START*/


let a1 = mapint(input().split(" "))
let a2 = mapint(input().split(" "))
let a3 = mapint(input().split(" "))
let n = parseInt(input())
let b = [];
for (let i = 0; i < n; i++){ 
    b.push(parseInt(input()))
}



for (let i = 0; i < 3; i++){ 
    if (b.includes(a1[i])){ a1[i] = 1 }else{ a1[i] = 0 }
}
for (let i = 0; i < 3; i++){ 
    if (b.includes(a2[i])){ a2[i] = 1 }else{ a2[i] = 0 }
}
for (let i = 0; i < 3; i++){ 
    if (b.includes(a3[i])){ a3[i] = 1 }else{ a3[i] = 0 }
}


let ans = 0
if (a1[0]+a1[1]+a1[2] == 3){ ans++ }
if (a2[0]+a2[1]+a2[2] == 3){ ans++ }
if (a3[0]+a3[1]+a3[2] == 3){ ans++ }
if (a1[0]+a2[0]+a3[0] == 3){ ans++ }
if (a1[1]+a2[1]+a3[1] == 3){ ans++ }
if (a1[2]+a2[2]+a3[2] == 3){ ans++ }
if (a1[0]+a2[1]+a3[2] == 3){ ans++ }
if (a1[2]+a2[1]+a3[0] == 3){ ans++ }
if (ans > 0){print("Yes")}else(print("No"))


/*END*/
stdout = stdout.join("\n");
console.log(stdout);
return stdout
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"))