open Scanf
open Printf

let rotation (c11, c12, c13) (c21, c22, c23) =
  if c11 = c23 && c12 = c22 && c13 = c21 then "YES" else "NO"

let c11, c12, c13 = sscanf (read_line ()) "%c%c%c" (fun a b c -> (a, b, c))
let c21, c22, c23 = sscanf (read_line ()) "%c%c%c" (fun a b c -> (a, b, c))

let () = printf "%s\n" (rotation (c11, c12, c13) (c21, c22, c23))