#include <bits/stdc++.h>
using namespace std;
char a, b, c, x, y, z, j, k, l;
int main() {
  cin >> a >> b >> c >> x >> y >> z >> j >> k >> l;
  if (a == l && b == k && c == j && x == z) {
    cout << "YES";
    return 0;
  }
  cout << "NO";
}
