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