#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  s1 = s1 + s2 + s3;
  for (int i = 0; i < 9; i++) {
    if (s1[i] != s1[8 - i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
