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