#include <bits/stdc++.h>
using namespace std;
char c[3][3];
int main() {
  for (register int i = 0; i < 3; ++i)
    for (register int j = 0; j < 3; ++j) cin >> c[i][j];
  bool flag = true;
  flag = (c[0][0] == c[2][2]) && (c[0][1] == c[2][1]) && (c[0][2] == c[2][0]) &&
         (c[1][0] == c[1][2]);
  if (flag)
    printf("YES");
  else
    printf("NO");
  return 0;
}
