#include <bits/stdc++.h>
using namespace std;
template <class T>
string tos(T x) {
  stringstream s;
  s << x;
  return s.str();
}
void cer(vector<int> ans) {
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << "  ";
  cout << endl;
}
int main() {
  char a[3][3];
  int sw = 0;
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) cin >> a[i][j];
  for (int i = 0; i <= 2 && sw == 0; i++)
    for (int j = 0; j <= 2; j++) {
      if (a[i][j] != a[2 - i][2 - j]) {
        sw = 1;
        break;
      }
    }
  (sw == 0 ? cout << "YES" : cout << "NO");
  return 0;
}
