function main(input) {
  input=input.trim();
  var a = input.split("\n")[0].split("")[0];
  var b = input.split("\n")[0].split("")[1];
  var c = input.split("\n")[0].split("")[2];
  var d = input.split("\n")[1].split("")[0];
  var e = input.split("\n")[1].split("")[1];
  var f = input.split("\n")[1].split("")[2];
  if(a==f&&b==e&&c==d){
    console.log("YES");
  }else{
    console.log("NO");
  }


}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

