; ソートして 3 項ずつ等差数列になっているかチェックし ; 全て等差数列になっていれば YES それ以外は NO を出力 (defun main () (let* ((n (read)) (xs (sort (loop repeat n collect (read)) #'<))) (princ (if (loop for (x1 x2 x3) on xs while x3 always (and (= (- x2 x1) (- x3 x2)) (/= x2 x1))) "YES" "NO")) (terpri))) (main)