(use '[clojure.string :only (split triml)]) (defn read-pair [] (mapv #(Long/parseLong %) (split (read-line) #" "))) ( let [ n_t (read-line) n (Integer/parseInt n_t) [Xs Ys] (loop [N n xs '() ys '()] (if (pos? N) (let [[x y] (read-pair)] (recur (dec N) (cons x xs) (cons y ys)) ) [xs ys])) ] (println (if (or (apply = Xs) (apply = Ys)) "YES" "NO")) )