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