#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> vs;
  vs.clear();
  string s;
  for (int i = 0; i < 3; i++) {
    cin >> s;
    vs.push_back(s);
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (vs[i][j] != vs[2 - i][2 - j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}
