#include <bits/stdc++.h>
using namespace std;
char a[3][3];
int main() {
  for (int row = 0; row < 3; ++row) {
    string s;
    cin >> s;
    for (int column = 0; column < 3; ++column) {
      a[row][column] = s[column];
    }
  }
  bool ok = true;
  for (int row = 0; row < 3; ++row) {
    for (int column = 0; column < 3; ++column) {
      if (a[row][column] == 'X' and a[2 - row][2 - column] != 'X') {
        ok = false;
      }
    }
  }
  if (ok)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
