#include <bits/stdc++.h>
const int N = 3;
using namespace std;
char d[N][N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> d[i][j];
    }
  }
  bool app = true;
  for (int i = 0; i <= 2 && app; i++) {
    for (int j = 0; j <= 2 && app; j++) {
      app = d[i][j] == d[2 - i][2 - j];
    }
  }
  cout << (app ? "YES" : "NO") << endl;
  return 0;
}
