"use strict"
function Main(stdin){
stdin = stdin.trim().split("\n").reverse();
let stdout = [];
function input(){return stdin.pop()};
function maput(){return input().split(" ").map(n=>parseInt(n))};
function print(x){stdout.push(x)};
function exist(x, xs){return new Set(xs).has(x)}
/*START*/


let a1 = maput()
let a2 = maput()
let a3 = maput()
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 (exist(a1[i], b)){ a1[i] = 1 }else{ a1[i] = 0 }
}
for (let i = 0; i < 3; i++){ 
    if (exist(a2[i], b)){ a2[i] = 1 }else{ a2[i] = 0 }
}
for (let i = 0; i < 3; i++){ 
    if (exist(a3[i], b)){ 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"))