#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<vector<int> > a(3, vector<int>(3, 0));
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) {
      char c;
      cin >> c;
      a[i][j] = c;
    }
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) {
      if (a[0][1] != a[2][1]) {
        cout << "NO";
        return 0;
      }
      if (a[1][0] != a[1][2]) {
        cout << "NO";
        return 0;
      }
      if (a[0][0] != a[2][2]) {
        cout << "NO";
        return 0;
      }
      if (a[2][0] != a[0][2]) {
        cout << "NO";
        return 0;
      }
    }
  cout << "YES";
  return 0;
}
