#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[4][4], b[4][5];
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j) cin >> a[i][j];
  for (int i = 2; i >= 0; --i)
    for (int j = 2; j >= 0; --j) b[i][j] = a[2 - i][2 - j];
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j)
      if (a[i][j] != b[i][j]) {
        cout << "NO";
        return 0;
      }
  cout << "YES";
  return 0;
}
