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