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