#include <bits/stdc++.h>
using namespace std;
int a, b, c, man, j, mix, x, y, z, ans, ans1, l, r, d[1000000];
vector<int> v, v1;
string s[100000], s1, s2;
map<string, int> mp, mp1;
bool o, bo;
long double ld;
pair<long long, long long> p[1000000];
int main() {
  cin >> s[0] >> s[1] >> s[2];
  if (s[0][0] != s[2][2])
    o = true;
  else if (s[1][0] != s[1][2])
    o = true;
  else if (s[2][0] != s[0][2])
    o = true;
  else if (s[2][1] != s[0][1])
    o = true;
  else
    o = false;
  if (o == false) {
    cout << "YES";
  } else
    cout << "NO";
}
