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