#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = LLONG_MAX;
void solve() {
  string s[3];
  int ans[10] = {0}, pos = 0;
  for (int i = 0; i < 3; i++) cin >> s[i];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (s[j][i] == 'X') {
        if (s[2 - j][2 - i] != 'X') {
          cout << "NO" << endl;
          return;
        }
      }
    }
  }
  cout << "YES" << endl;
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
