function Main (C) {
  C = C.split("\n").map(inp => inp.split(""));
  C.pop();
  var F = [
    [C[1][2], C[1][1], C[1][0]],
    [C[0][2], C[0][1], C[0][0]]
  ];
  var ans = "YES";
  for (var i = 0; i < 2; i++) {
    for (var j = 0; j < 3; j++) {
      if (F[i][j] != C[i][j]) {
        ans = "NO";
      }
    }
  }
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));