#include <bits/stdc++.h>
using namespace std;
int main() {
  char c1[3][3], c2[3][3];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> c1[i][j];
      c2[3 - 1 - i][3 - 1 - j] = c1[i][j];
    }
  }
  long long int f = 0;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (c1[i][j] != c2[i][j]) f = 1;
    }
  }
  if (f == 1)
    cout << "NO";
  else
    cout << "YES";
}
