#include <bits/stdc++.h>
time_t waktu = clock();
void gettime() {
  printf("\nTime : %.2lf", (clock() - waktu) / double(CLOCKS_PER_SEC));
}
int comp(int a, int b) { return (a > b); }
using namespace std;
int main() {
  int cek = 1, i;
  char data[10][10];
  for (i = 0; i < 3; i++) {
    scanf("%s", &data[i]);
  }
  if (data[0][0] != data[2][2]) cek = 0;
  if (data[0][1] != data[2][1]) cek = 0;
  if (data[0][2] != data[2][0]) cek = 0;
  if (data[1][0] != data[1][2]) cek = 0;
  if (cek == 0)
    printf("No");
  else
    printf("Yes");
  return 0;
}
