#include <bits/stdc++.h>
using namespace std;
bool pali(string c) {
  int n = c.size();
  for (int i = 0; i < n / 2; i++) {
    if (c[i] != c[n - 1 - i]) return false;
  }
  return true;
}
int main() {
  string a, b, c;
  while (cin >> a >> b >> c) {
    if (pali(a + c) && b[0] == b[2])
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
