#include <bits/stdc++.h>
using namespace std;
void solve() {
  char a[6][6];
  bool flag = true;
  for (int i = 0; i < 3; ++i) cin >> a[i];
  if (a[0][0] != a[2][2]) {
    flag = false;
  }
  if (a[0][1] != a[2][1]) {
    flag = false;
  }
  if (a[0][2] != a[2][0]) {
    flag = false;
  }
  if (a[1][0] != a[1][2]) {
    flag = false;
  }
  if (flag)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  while (tc--) {
    solve();
  }
  return 0;
}
