#include <bits/stdc++.h>
using namespace std;
string sym[5];
int main() {
  char arr[5][5];
  for (int i = 0; i < 3; i++) cin >> arr[i];
  if (arr[0][0] == arr[2][2] && arr[0][1] == arr[2][1] &&
      arr[0][2] == arr[2][0] && arr[1][0] == arr[1][2]) {
    printf("YES");
  } else {
    printf("NO");
  }
}
