#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, d, f;
  cin >> s;
  cin >> d;
  cin >> f;
  if (s[0] == f[2] && s[1] == f[1] && s[2] == f[0] && d[0] == d[2]) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
