#include <bits/stdc++.h>
using namespace std;
int main() {
  char ar[3][3];
  for (int i = 0; i < 3; i++) {
    scanf("%s", ar[i]);
  }
  if (ar[0][0] == ar[2][2] && ar[0][1] == ar[2][1] && ar[0][2] == ar[2][0] &&
      ar[1][0] == ar[1][2])
    printf("YES");
  else
    printf("NO");
}
