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