#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
char a[3][3], b[3][3];
long long col = 0;
int main() {
  for (int i = 1; i <= (int)(3); i++) {
    for (int j = 1; j <= (int)(3); j++) {
      cin >> a[i][j];
    }
  }
  b[1][1] = a[3][3];
  b[1][2] = a[3][2];
  b[1][3] = a[3][1];
  b[2][1] = a[2][3];
  b[2][2] = a[2][2];
  b[2][3] = b[2][1];
  for (int i = 1; i <= (int)(2); i++) {
    for (int j = 1; j <= (int)(3); j++) {
      if (a[i][j] == b[i][j]) col++;
    }
  }
  if (col == 6)
    cout << "YES";
  else
    cout << "NO";
  fclose(stdin);
  fclose(stdout);
}
