inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
a = []
a[0] = inp.shift().split(' ').map(x => +x)
a[1] = inp.shift().split(' ').map(x => +x)
a[2] = inp.shift().split(' ').map(x => +x)
N = inp.shift() * 1
for (i=0; i<N; i++) {
    for(j=0;j<3;j++) {
        for(k=0;k<3;k++) {
            if (a[j][k] == inp[i]) {
                a[j][k] = 0
            }
        }
    }
}
b = false
for(j=0;j<3;j++) {
    c = true
    for(k=0;k<3;k++) {
        c = a[j][k] === 0 && c
    }
    if (c) {
        b = true
    }
}
for(j=0;j<3;j++) {
    c = true
    for(k=0;k<3;k++) {
        c = a[k][j] === 0 && c
    }
    if (c) {
        b = true
    }
}

if (a[0][0] === 0 && a[1][1] === 0 && a[2][2] === 0) {
    b = true
}

if (a[2][0] === 0 && a[1][1] === 0 && a[0][2] === 0) {
    b = true
}

console.log(b ? "Yes" : "No")