#include <bits/stdc++.h>
using namespace std;
void solve() {
  string str, str2;
  cin >> str >> str2;
  str += str2;
  cin >> str2;
  str += str2;
  str2 = str;
  reverse(str.begin(), str.end());
  if (str == str2)
    cout << "YES";
  else
    cout << "NO";
}
int main() {
  solve();
  return 0;
}
