#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[3];
  for (int i = 0; i < 3; ++i) cin >> s[i];
  for (int i = 0; i < 3; ++i) {
    if (s[0][i] == 'X') {
      if (s[2][2 - i] == 'X')
        continue;
      else {
        cout << "NO";
        return 0;
      }
    }
  }
  for (int i = 0; i < 3; ++i) {
    if (s[2][i] == 'X') {
      if (s[0][2 - i] == 'X')
        continue;
      else {
        cout << "NO";
        return 0;
      }
    }
  }
  if (s[1][0] == 'X' and s[1][2] == '.' or s[1][0] == '.' and s[1][2] == 'X') {
    cout << "NO";
    return 0;
  }
  cout << "YES";
  return 0;
}
