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