#include <bits/stdc++.h>
using namespace std;
int a[15][15];
int main() {
  int n = 3;
  string s;
  for (int i = 1; i <= n; ++i) {
    cin >> s;
    for (int j = 0; j <= (int)s.size() - 1; ++j) {
      if (s[j] == 'X')
        a[i][j + 1] = 1;
      else
        a[i][j + 1] = 0;
    }
  }
  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])
    puts("YES");
  else
    puts("NO");
  return 0;
}
