#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
void test_case() {
  vector<string> s(3);
  cin >> s[0] >> s[1] >> s[2];
  if (s[0][0] == s[2][2] && s[0][2] == s[2][0] && s[0][1] == s[2][1] &&
      s[1][0] == s[1][2])
    cout << "YES";
  else
    cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) test_case();
}
