#include <bits/stdc++.h>
using namespace std;
char mat[5][5];
void rotate90() {
  char tmp[5][5];
  memcpy(tmp, mat, sizeof(mat));
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j) mat[i][j] = tmp[j][3 - i - 1];
}
int main() {
  for (int i = 0; i < 3; ++i) scanf("%s", &mat[i]);
  char ori[5][5];
  memcpy(ori, mat, sizeof(mat));
  rotate90();
  rotate90();
  bool same = 1;
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j)
      if (ori[i][j] != mat[i][j]) same = 0;
  printf("%s\n", same ? "YES" : "NO");
  return 0;
}
