#include <bits/stdc++.h>
using namespace std;
char a[4][4];
int b[4][4];
void ENTER() {
  for (int i = 1; i <= 3; i++)
    for (int j = 1; j <= 3; j++) {
      cin >> a[i][j];
      if (a[i][j] == 'X')
        b[i][j] = 1;
      else
        b[i][j] = 0;
    }
  b[2][2] = 0;
}
bool ct() {
  for (int i = 1; i <= 3; i++) {
    if (a[1][i] != a[3][4 - i]) return 0;
    if (a[i][1] != a[4 - i][3]) return 0;
  }
  return 1;
}
int main() {
  ENTER();
  if (ct())
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
