#include <bits/stdc++.h>
using namespace std;
char a[5][5];
int main() {
  cin >> a[1][1] >> a[1][2] >> a[1][3] >> a[2][1] >> a[2][2] >> a[2][3] >>
      a[3][1] >> a[3][2] >> a[3][3];
  if (a[1][1] == a[3][3] && a[1][2] == a[3][2] && a[1][3] == a[3][1] &&
      a[2][1] == a[2][3])
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
