#include <bits/stdc++.h>
using namespace std;
int main() {
  int s = 0, x, n, m, i, j, t = 0, q = 0, d;
  string a[3];
  cin >> a[0];
  cin >> a[1];
  cin >> a[2];
  if (a[0][0] == a[2][2] && a[0][1] == a[2][1] && a[0][2] == a[2][0] &&
      a[1][0] == a[1][2])
    cout << "YES";
  else
    cout << "NO";
}
