#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, temp = 0;
  char x[5][5];
  for (i = 0; i < 3; i++) gets(x[i]);
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++)
      if (x[i][j] != x[2 - i][2 - j]) temp = 1;
  if (temp == 1)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
