#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[3][3], N, b[N];
  cin >> a[0][0] >> a[0][1] >> a[0][2];
  cin >> a[1][0] >> a[1][1] >> a[1][2];
  cin >> a[2][0] >> a[2][1] >> a[2][2];
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < 3; j++) {
      for (int k = 0; k < 3; k++) {
        if (b[i] == a[j][k]) {
          a[j][k] = 0;
        }
      }
    }
  }
  if (a[0][0] == 0 && a[0][1] == 0 && a[0][2] == 0)
    cout << "Yes"
         << "\n";
  else if (a[1][0] == 0 && a[1][1] == 0 && a[1][2] == 0)
    cout << "Yes"
         << "\n";
  else if (a[2][0] == 0 && a[2][1] == 0 && a[2][2] == 0)
    cout << "Yes"
         << "\n";
  else if (a[0][0] == 0 && a[1][0] == 0 && a[2][0] == 0)
    cout << "Yes"
         << "\n";
  else if (a[0][1] == 0 && a[1][1] == 0 && a[2][1] == 0)
    cout << "Yes"
         << "\n";
  else if (a[0][2] == 0 && a[1][2] == 0 && a[2][2] == 0)
    cout << "Yes"
         << "\n";
  else if (a[0][0] == 0 && a[1][1] == 0 && a[2][2] == 0)
    cout << "Yes"
         << "\n";
  else if (a[0][2] == 0 && a[1][1] == 0 && a[2][0] == 0)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
}
