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