let () = let a = Array.init 3 (fun _ -> Scanf.scanf " %d" (fun a -> a)) in let b = Array.init 3 (fun _ -> Scanf.scanf " %d" (fun a -> a)) in let check i j = let check2 arr = arr.(0) <> arr.(1) && arr.(1) <> arr.(2) && arr.(2) <> arr.(0) && ( (arr.(1) < arr.(0) && arr.(1) < arr.(2)) || (arr.(1) > arr.(0) && arr.(1) > arr.(2)) ) in let a = Array.copy a in let b = Array.copy b in let c = a.(i) in a.(i) <- b.(j); b.(j) <- c; check2 a && check2 b in let rec loop i j = if j = 3 then false else if i = 3 then loop 0 (j + 1) else if check i j then true else loop (i + 1) j in print_endline @@ if loop 0 0 then "Yes" else "No"