There is a very secret base in Potatoland where potato mash is made according to a special recipe. The neighbours from Porridgia decided to seize this recipe and to sell it to Pilauland. For this mission they have been preparing special agent Pearlo for many years. When, finally, Pearlo learned all secrets of espionage, he penetrated into the Potatoland territory and reached the secret base.

Now he is standing at the entrance, but to get inside he need to pass combination lock. Minute ago one of the workers entered the password on the terminal and opened the door. The terminal is a square digital keyboard 3 × 3 with digits from 1 to 9.

Pearlo knows that the password consists from distinct digits and is probably symmetric with respect to the central button of the terminal. He has heat sensor which allowed him to detect the digits which the worker pressed. Now he wants to check whether the password entered by the worker is symmetric with respect to the central button of the terminal. This fact can Help Pearlo to reduce the number of different possible password combinations.
Input contains the matrix of three rows of three symbols each. Symbol «X» means that the corresponding button was pressed, and «.» means that is was not pressed. The matrix may contain no «X», also it may contain no «.».
XX.
...
.XX
YES
.X.
.X.
.X.
YES
XXX
XXX
XXX
YES
XXX
X.X
XXX
YES
X..
.X.
..X
YES
...
X.X
X..
NO
.X.
X.X
.X.
YES
X.X
.X.
X.X
YES
...
...
..X
NO
XXX
...
XXX
YES
..X
X..
..X
NO
.X.
...
X.X
NO
X.X
X.X
X.X
YES
.X.
X.X
XX.
NO
...
XXX
XXX
NO
XXX
..X
XXX
NO
X..
X.X
.X.
NO
...
..X
XXX
NO
..X
X.X
X..
YES
..X
..X
XXX
NO
X..
X..
X..
NO
XXX
.X.
XXX
YES
..X
...
X..
YES
...
...
X..
NO
...
...
.X.
NO
...
...
..X
NO
...
.X.
X..
NO
/******************************************
* CODER       : ANIRBAN DEY               *
* NICK        : nonstop-baban(since 2001) *
* INSTITUTION : IIEST, SHIBPUR(2019-2023) *
*******************************************/

#include <bits/stdc++.h>

using namespace std;

typedef string                       str;
typedef long long                    ll;
typedef long double                  ld;
typedef vector<int>                  vi;
typedef priority_queue<int>          pqi;
typedef vector<ll>                   vll;
typedef vector<str>                  vs;
typedef vector<char>                 vc;
typedef pair<ll,ll>                  pll;
typedef vector<pll>                  vpll;
typedef map<ll,ll>                   mll;
typedef set<ll>                      sll;

#define f(i, a, n)                   for (ll i = a; i < n; i++)
#define f2(i, a, b)                  for (ll i = a; i <= b; i++)
#define f3(i, n, m)                  for (ll i = n; i >= m; i--)
#define ptr_f(i,x)                   for(auto i=x.begin();i!=x.end();i++)
#define pb                           push_back
#define pf                           push_front
#define pob                          pop_back
#define pof                          pop_front
#define eb                           emplace_back
#define ef                           emplace_front
#define mp                           make_pair
#define all(a)                       (a).begin(), (a).end()
#define dcml(x)                      cout<<fixed<<setprecision(x);
#define setbits(x)                   __builtin_popcountll(x)
#define zerobits(x)                   __builtin_ctzll(x)
#define fsort(a)                     sort(all(a))
#define gsort(a)                     sort(all(a),greater<>())
#define rsort(a)                     sort(a.rbegin(), a.rend())
#define w(t)                         ll t; cin>>t; while(t--)
#define FF                           first
#define SS                           second
#define sz(x)                        ((int)(x).size())
#define fast_cin()                   ios_base::sync_with_stdio(false); cin.tie(NULL)
#define fill0(a)                     memset(a, 0, sizeof (a))
#define fill1(a)                     memset(a, -1, sizeof (a))
#define gcd(a,b)                     __gcd(a,b)
#define lcm(a,b)                     (a*b)/__gcd(a,b)
#define bs(v,x)                      binary_search(all(v),x)
#define ub(v,x)                      upper_bound(all(v),x)-v.begin()
#define lb(v,x)                      lower_bound(all(v),x)-v.begin()
#define maxi(x)                      *max_element(all(x))
#define mini(x)                      *min_element(all(x))
#define endl                         '\n'

const ll MOD     = 1e9 + 7;
const ll SIZE    = 100000;
const int INF    = 0x3f3f3f3f;
const ll ll_INF  = 0x3f3f3f3f3f3f3f3f;
const ld PI      = acos(-1);
const ll MAXN    = numeric_limits<ll>::max();
const ll MAX     = 2000000;

/*bool sortinrev(const pll &a,const pll &b){
return (a.FF>b.FF);
}*/

/*bool sortbysec(const pll &a,const pll &b){
return (a.SS<b.SS);
}*/

/*bool sortbysecdesc(const pll &a,const pll &b){
return (a.SS>b.SS);
}*/

/*bool isprime(ll n)
{
  if(n<=1) return false;
  f2(i,2,sqrt(n))
  if(n%i==0)
   return false;

  return true;
}*/

void disp(vll v)
{
   for(auto u:v)
   cout<<u<<" ";
   cout<<endl;
}
void solve()
{
   str s[3];
   f(i,0,3) cin>>s[i];
   f(i,0,3)
   {
     if(s[0][i]!=s[2][3-i-1])
     {
       cout<<"NO\n";
       return;
     }
   }
   cout<<"YES\n";
}

int main()
{
  fast_cin();
//w(t1)
  solve();

  return 0;
}
