#include <bits/stdc++.h>
using namespace std;
int main() {
  char a, b, c, d, e, f, g, h, i;
  cin >> a >> b >> c >> d >> e >> f >> g >> h >> i;
  if (a == i && b == h && c == g && d == f)
    cout << "YES";
  else
    cout << "NO";
}
