#include <bits/stdc++.h>
using namespace std;
char board[4][4];
int main() {
  for (int i = 0; i < 3; i++) scanf("%s", board[i]);
  if (board[0][0] != board[2][2] || board[0][1] != board[2][1] ||
      board[0][2] != board[2][0] || board[1][0] != board[1][2]) {
    printf("NO");
    return 0;
  } else
    printf("YES");
  return 0;
}
