#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  char v[3][3];
  long long r = 2, c = 2;
  for (long long i = 0; i <= r; i++) {
    for (long long j = 0; j <= c; j++) {
      cin >> v[i][j];
    }
  }
  long long flag = 0;
  for (long long i = 0; i <= r; i++) {
    for (long long j = 0; j <= c; j++) {
      if (v[i][j] != v[r - i][c - j]) {
        flag = 1;
        break;
      }
    }
  }
  if (flag)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
