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