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