#include <bits/stdc++.h>
#pragma hdrstop
#pragma argsused
using namespace std;
int main() {
  int d = 0;
  string a, b, c;
  cin >> a;
  cin >> b;
  cin >> c;
  if (a[0] != c[2]) {
    b = 1;
  }
  if (a[1] != c[1]) {
    d = 1;
  }
  if (a[2] != c[0]) {
    d = 1;
  }
  if (b[0] != b[2]) {
    d = 1;
  }
  if (d == 0) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
