#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b = 0, c = 0, m = 0, n = 0, v = 0;
  char h[9];
  bool f = true;
  for (int i = 0; i < 9; i++) {
    cin >> h[i];
  }
  for (int i = 0; i < 9; i++) {
    if (h[i] != h[8 - i]) {
      f = false;
    }
  }
  if (f) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
