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