#include <bits/stdc++.h>
using namespace std;
char s[9];
int main() {
  for (int i = 0; i < 9; i++) cin >> s[i];
  for (int i = 0; i < 9; i++) {
    if (s[i] != s[8 - i]) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
  return 0;
}
