package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
	"unsafe"
)

func main() {
	A1 := sc.nextInts()
	A2 := sc.nextInts()
	A3 := sc.nextInts()

	N := sc.nextInt()

	for i := 0; i < N; i++ {
		ta := sc.nextInt()
		for i, v := range A1 {
			if v == ta {
				A1[i] = -1
			}
		}

		for i, v := range A2 {
			if v == ta {
				A2[i] = -1
			}
		}

		for i, v := range A3 {
			if v == ta {
				A3[i] = -1
			}
		}
	}

	if check(A1, A2, A3) {
		yes()
	} else {
		no()
	}
}

func check(A1 []int, A2 []int, A3 []int) bool {
	if A1[0] == -1 && A2[0] == -1 && A3[0] == -1 {
		return true
	}
	if A1[1] == -1 && A2[1] == -1 && A3[1] == -1 {
		return true
	}
	if A1[2] == -1 && A2[2] == -1 && A3[2] == -1 {
		return true
	}

	if A1[0] == -1 && A1[1] == -1 && A1[2] == -1 {
		return true
	}
	if A2[0] == -1 && A2[1] == -1 && A2[2] == -1 {
		return true
	}
	if A3[0] == -1 && A3[1] == -1 && A3[2] == -1 {
		return true
	}

	if A1[0] == -1 && A2[1] == -1 && A3[2] == -1 {
		return true
	}
	if A1[2] == -1 && A2[1] == -1 && A3[0] == -1 {
		return true
	}

	return false
}

/* template functions */
var (
	sc scanner
)

func init() {
	sc = scanner{
		buf: make([]string, 0, 0),
		cur: 0,
		r:   bufio.NewReader(os.Stdin),
	}
}

type scanner struct {
	buf []string
	cur int
	r   *bufio.Reader
}

func (s *scanner) readln() {
	rbuf := make([]byte, 0, 0)
	for {
		line, prefix, err := s.r.ReadLine()
		if err != nil {
			panic(err)
		}
		rbuf = append(rbuf, line...)
		if prefix == false {
			break
		}
	}
	s.cur = 0
	s.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), " ")
}
func (s *scanner) isFull() bool {
	if s.cur == len(s.buf) {
		return true
	}
	return false
}
func (s *scanner) resetCur() {
	s.cur = 0
}
func (s *scanner) next() string {
	if s.cur == 0 {
		s.readln()
	}
	res := s.buf[s.cur]
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nexts() []string {
	s.readln()
	s.resetCur()
	return s.buf
}
func (s *scanner) nextInt() int {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.Atoi(s.buf[s.cur])
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextInts() []int {
	s.readln()
	res := make([]int, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.Atoi(s.buf[i])
	}
	s.resetCur()
	return res
}
func (s *scanner) nextFloat() float64 {
	if s.cur == 0 {
		s.readln()
	}
	res, _ := strconv.ParseFloat(s.buf[s.cur],
		64)
	s.cur++
	if s.isFull() {
		s.resetCur()
	}
	return res
}
func (s *scanner) nextFloats() []float64 {
	s.readln()
	res := make([]float64, len(s.buf))
	for i := range s.buf {
		res[i], _ = strconv.ParseFloat(s.buf[i],
			64)
	}
	s.resetCur()
	return res
}
func digits(x int) int {
	return len(strconv.Itoa(x))
}
func powInt(x, p int) (result int) {
	result = 1
	for i := 0; i < p; i++ {
		result *= x
	}
	return
}
func max(x, y int) int {
	return int(math.Max(float64(x), float64(y)))
}
func min(x, y int) int {
	return int(math.Min(float64(x), float64(y)))
}
func abs(x int) int {
	return int(math.Abs(float64(x)))
}
func varDump(value ...interface{}) {
	for _, v := range value {
		fmt.Fprintf(os.Stderr, "%#v\n", v)
	}
}
func yes() {
	fmt.Println("Yes")
}
func no() {
	fmt.Println("No")
}


Measured memory_bytes: 640