#include <bits/stdc++.h>
using namespace std;
void solve() {
  char s[10];
  for (int i = 0; i < 9; i++) cin >> s[i];
  bool t = false;
  for (int i = 0; i < 9; i++) {
    if (s[i] != s[8 - i]) {
      t = true;
      break;
    }
  }
  if (t)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
