#include <bits/stdc++.h>
using namespace std;
int rt = 1;
char c[3][3];
inline void Main();
int main() {
  while (rt--) {
    Main();
  }
  return 0;
}
inline void Main() {
  cin >> c[0] >> c[1] >> c[2];
  if (c[0][0] == c[2][2] && c[0][1] == c[2][1] && c[0][2] == c[2][0] &&
      c[1][0] == c[1][2]) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
}
