#include <bits/stdc++.h>
using namespace std;
int main() {
  char random;
  int i, j, flag = 1, c = 0;
  int matrix[3][3];
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      cin >> random;
      if (random == 'X') {
        matrix[i][j] = 1;
      } else {
        matrix[i][j] = 0;
        c++;
      }
      random = '\0';
    }
  }
  if (c == 9)
    cout << "YES";
  else {
    for (i = 0; i < 3; i++) {
      for (j = 0; j < 3; j++) {
        if (matrix[i][j] == 1 && matrix[2 - i][2 - j] == 1) {
          flag = 1;
        } else if (matrix[i][j] == 0)
          continue;
        else {
          flag = 0;
          break;
        }
      }
      if (flag == 0) break;
    }
    if (flag == 1)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
