#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  bool no = true;
  for (int i = 0, j = s1.length() - 1; i < s1.length(); i++, j--) {
    if (s1[i] != s3[j]) {
      cout << "NO";
      no = false;
      break;
    }
    if (s2[0] != s2[2]) {
      cout << "NO";
      no = false;
      break;
    }
  }
  if (no) {
    cout << "YES";
  }
  return 0;
}
