#include <bits/stdc++.h>
using namespace std;
int main() {
  char f[3][3];
  long long n = 3;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      cin >> f[i][j];
    }
  }
  if (f[0][0] == f[2][2] and f[0][1] == f[2][1] and f[0][2] == f[2][0] and
      f[1][0] == f[1][2])
    cout << "YES\n";
  else
    cout << "NO\n";
}
