#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  char s[5][5];
  bool f = 1;
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) cin >> s[i][j];
  }
  if (s[1][1] != s[3][3]) f = 0;
  if (s[1][2] != s[3][2]) f = 0;
  if (s[1][3] != s[3][1]) f = 0;
  if (s[2][1] != s[2][3]) f = 0;
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
