#include <bits/stdc++.h>
using namespace std;
long long power(long long b, long long p) {
  if (p == 0)
    return 1;
  else
    return b * power(b, p - 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  char arr[3][3];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> arr[i][j];
    }
  }
  for (int i = 0; i < 3; i++) {
    if (arr[0][i] != arr[2][2 - i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  if (arr[1][0] != arr[1][2]) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  return 0;
}
