#include <bits/stdc++.h>
using namespace std;
string a, b, c;
int main() {
  cin >> a >> b >> c;
  if (a[0] == c[2] && a[1] == c[1] && a[2] == c[0] &&
      (b == ".X." || b == "XXX" || b == "X.X" || b == "...")) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
