#include <bits/stdc++.h>
using namespace std;
int main() {
  char matr[3][3];
  int s = 0;
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) cin >> matr[i][j];
  if (matr[0][0] != matr[2][2]) s++;
  if (matr[1][0] != matr[1][2]) s++;
  if (matr[0][1] != matr[2][1]) s++;
  if (matr[0][2] != matr[2][0]) s++;
  if (s != 0) cout << "NO";
  if (s == 0) cout << "YES";
  cin.get();
  cin.get();
}
