#include <bits/stdc++.h>
using namespace std;
char s[5][5];
int flag;
int main() {
  for (int i = 1; i <= 3; i++) scanf("%s", s[i] + 1);
  if (s[1][1] == s[3][3] && s[1][2] == s[3][2] && s[1][3] == s[3][1] &&
      s[2][3] == s[2][1])
    flag = 1;
  else
    flag = 0;
  if (flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
