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