#include <bits/stdc++.h>
int main(void) {
  int a[3][3], b, c[3][3], i, j, k, n, bingo = 0;
  for (i = 0; i < 3; i++) {
    scanf("%d %d %d", &a[i][0], &a[i][1], &a[i][2]);
  }
  scanf("%d", &n);
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      c[i][j] = 0;
    }
  }
  for (i = 0; i < 3; i++) {
    if (1) {
      printf("%d %d %d\n", c[i][0], c[i][1], c[i][2]);
    }
  }
  for (i = 0; i < 3; i++) {
    if (c[i][0] + c[i][1] + c[i][2] == 3)
      bingo = 1;
    else if (c[0][i] + c[1][i] + c[2][i] == 3)
      bingo = 1;
  }
  if (c[0][0] + c[1][1] + c[2][2] == 3) bingo = 1;
  if (c[2][0] + c[1][1] + c[0][2] == 3) bingo = 1;
  if (bingo == 1)
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
