#include <bits/stdc++.h>
using namespace std;
int main() {
  char ar[3][3];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      char c;
      cin >> c;
      ar[i][j] = c;
    }
  }
  int x = 3;
  bool flag = true;
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < x; j++) {
      if (ar[i][j] != ar[2 - i][2 - j]) {
        flag = false;
      }
    }
    x--;
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
}
