#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
bool is_vowel(char c) {
  c = tolower(c);
  return c == 'a' || c == 'e' || c == 'o' || c == 'i' || c == 'u' || c == 'y';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  char field[3][3];
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) cin >> field[i][j];
  bool res = true;
  if (field[0][0] != field[2][2]) res = false;
  if (field[0][1] != field[2][1]) res = false;
  if (field[0][2] != field[2][0]) res = false;
  if (field[1][0] != field[1][2]) res = false;
  cout << (res ? "YES" : "NO");
  return 0;
}
