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