#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int cnt, t, y, m, n, a, b, i, j, x, z, sum, k;
  string str, str1, str2;
  cin >> str >> str1 >> str2;
  reverse(str2.begin(), str2.end());
  if ((str == str2) && (str1[0] == str1[2])) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
