#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 3;
  vector<vector<char> > ar(n, vector<char>(n));
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) cin >> ar[i][j];
  }
  bool f = 1;
  for (int i = 0; i < 1; ++i) {
    for (int j = 0; j < n; ++j) {
      if (ar[i][j] != ar[n - i - 1][n - j - 1]) {
        f = 0;
      }
    }
  }
  if (ar[1][0] != ar[1][2]) {
    f = 0;
  }
  if (f) {
    cout << "YES";
  } else
    cout << "NO";
}
