#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[20];
  int x, i, j;
  x = 0;
  for (i = 1; i <= 3; i++) {
    for (j = 1; j <= 4; j++) {
      if (j == 4) {
        getchar();
        break;
      }
      a[x] = getchar();
      x++;
    }
  }
  x = 8;
  j = 0;
  for (i = 0; i < 9; i++) {
    if (a[i] == a[x]) {
      j++;
    }
    x--;
  }
  if (j == 9)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
