import java.util.Scanner
import kotlin.system.exitProcess

fun main(args: Array<String>) {
	val scn = Scanner(System.`in`)
	val sheet = Array(3){IntArray(3){scn.nextInt()} }
	val n = scn.nextInt()
	val bs = IntArray(n){scn.nextInt()}
	val holes = Array(3){i -> BooleanArray(3){j -> sheet[i][j] in bs} }
	repeat(3){ i ->
		if (holes[i].all { it }) yes()
		if (holes.all {it[i]}) yes()
	}
	if ((0..2).all{holes[it][it]}) yes()
	if ((0..2).all{holes[it][2-it]}) yes()
	print("No")
}

fun yes(){
	print("Yes")
	exitProcess(0)
}