#include <bits/stdc++.h>
using namespace std;
int const N = 1e6 + 3;
long long MOD = 1e9 + 7, fact[N];
const long long INF = (long long)1e18;
const long double PI = 3.14159265358979;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  vector<string> a(3);
  for (int i = 0; i < 3; i++) {
    cin >> a[i];
  }
  bool ok = false;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (a[i][j] == 'X') {
        if (a[2 - i][2 - j] == 'X') {
          continue;
        } else {
          ok = true;
          break;
        }
      }
    }
  }
  if (ok) {
    cout << "NO"
         << "\n";
  } else {
    cout << "YES"
         << "\n";
  }
  return 0;
}
