#include <bits/stdc++.h>
using namespace std;
int main() {
  char arr[10];
  for (int i = 0; i < 9; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < 5; i++) {
    if (arr[i] != arr[8 - i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
