#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  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";
  return 0;
}
