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