#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[3];
  for (int i = 0; i < 3; i++) {
    cin >> s[i];
  }
  int temp = 0;
  bool no = 0;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (s[i][j] == s[2 - i][2 - j]) {
        temp++;
      } else {
        no = 1;
        cout << "NO" << endl;
        break;
      }
    }
    if (no == 1) {
      break;
    }
  }
  if (temp == 9) {
    cout << "YES" << endl;
  }
  return 0;
}
