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