object Main extends App { 
	val sc = new java.util.Scanner (System.in)
	val matrix:List[List[Int]] = List(List.fill(3)(sc.nextInt),List.fill(3)(sc.nextInt),List.fill(3)(sc.nextInt))
	val n = sc.nextInt
	val b = for ( i <- 1 to n) yield (sc.nextInt)
	val c = matrix.map(x => x.map( y => if( b.indexOf(y) < 0) y else -1 ) )

	if (c(0)(0) == -1 & c(0)(1) == -1 & c(0)(2) == -1){
		println("Yes")
	}else if (c(0)(0) == -1 & c(1)(1) == -1 & c(2)(2) == -1){
		println("Yes")
	}else if (c(0)(0) == -1 & c(1)(0) == -1 & c(2)(0) == -1){
		println("Yes")
	}else if (c(0)(2) == -1 & c(1)(1) == -1 & c(2)(0) == -1){
		println("Yes")
	}else if (c(2)(0) == -1 & c(2)(1) == -1 & c(2)(2) == -1){
		println("Yes")
	}else if (c(0)(2) == -1 & c(1)(2) == -1 & c(2)(2) == -1){
		println("Yes")
	}else{
		println("No")
	}
}

