#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b, c, t1, t2;
  cin >> a >> b >> c;
  t1 = a;
  t2 = b;
  reverse(t1.begin(), t1.end());
  reverse(t2.begin(), t2.end());
  if (t1 == c && t2 == b) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
