#include <bits/stdc++.h>
int main() {
  int i, j, sayac = 0;
  char dizi[3][3], c;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) {
      scanf("%c", &c);
      if (c != '\n')
        dizi[i][j] = c;
      else {
        j--;
        continue;
      }
    }
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++)
      if (dizi[i][j] != dizi[2 - i][2 - j]) sayac++;
  if (sayac > 0)
    printf("NO");
  else
    printf("YES");
  return 0;
}
