#include <bits/stdc++.h>
int main() {
  char str[4][4];
  int i;
  for (i = 0; i < 3; i++) scanf("%s", str[i]);
  if (str[0][0] == str[2][2] && str[0][1] == str[2][1] &&
      str[0][2] == str[2][0] && str[1][0] == str[1][2])
    printf("YES");
  else
    printf("NO");
  return 0;
}
