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