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