#include <bits/stdc++.h>
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, -1, 0, 1};
using namespace std;
char a[4][4];
void init() {
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) a[i][j] = getchar();
    getchar();
  }
}
bool check() {
  if (a[0][0] != a[2][2]) return 0;
  if (a[0][1] != a[2][1]) return 0;
  if (a[0][2] != a[2][0]) return 0;
  if (a[1][0] != a[1][2]) return 0;
  return 1;
}
int main() {
  init();
  if (check())
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
