#include <bits/stdc++.h>
using namespace std;
int main() {
  string M[3];
  for (int i = 0; i < 3; ++i) {
    cin >> M[i];
  }
  bool symm = true;
  for (int i = 0; i <= 4; ++i) {
    int a = i, b = 8 - i;
    if (M[a / 3][a % 3] != M[b / 3][b % 3]) {
      symm = false;
    }
  }
  cout << (symm ? "YES" : "NO") << endl;
  return 0;
}
