#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, c, d, e, i, j, x[100000], y = 0, xx;
  string s, z, p;
  cin >> s >> z >> p;
  if (s[0] == p[2] && s[1] == p[1] && s[2] == p[0] && z[0] == z[2]) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
}
