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