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