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