#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n, i, count = 0;
  vector<long long int> v;
  string s1, s2, s3, reverses1, reverses2, reverses3;
  cin >> s1 >> s2 >> s3;
  reverses1 = s1;
  reverses2 = s2;
  reverses3 = s3;
  reverse(s1.begin(), s1.end());
  reverse(s2.begin(), s2.end());
  reverse(s3.begin(), s3.end());
  if (reverses1 == s3 && reverses2 == s2 && reverses3 == s1)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
}
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
int main() {
  fast();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
