#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.141592653589793238L;
int main() {
  string s[3];
  cin >> s[0] >> s[1] >> s[2];
  reverse(s[2].begin(), s[2].end());
  if (s[2] == s[0] && s[1][0] == s[1][2]) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
