let () =
  let (a, b, c) = Scanf.scanf "%d %d %d\n" (fun i j k -> (i, j, k)) in
  let (d, e, f) = Scanf.scanf "%d %d %d\n" (fun i j k -> (i, j, k)) in
  if (a = f) && (b = e) && (c = d) then
    print_endline "YES"
  else
    print_endline "NO"