#include <bits/stdc++.h>
using namespace std;
int solve(void) {
  int ck = 0;
  string p[3];
  for (int i = 0; i < (int)3; i += 1) cin >> p[i];
  for (int i = 0; i < (int)3; i += 1) ck += p[0][i] == p[2][2 - i];
  ck += p[1][0] == p[1][2];
  if (ck == 4) {
    cout << "YES" << endl;
    ;
  } else {
    cout << "NO" << endl;
    ;
  }
  return 0;
}
int main(void) {
  solve();
  return 0;
}
