#include <bits/stdc++.h>
using namespace std;
char a[10];
char b[10];
int main() {
  for (int i = 0; i < 3; ++i) cin >> a + i * 3;
  strcpy(b, a);
  reverse(a, a + 9);
  if (!strcmp(a, b))
    cout << "YES";
  else
    cout << "No";
  return 0;
}
