(defun main (&rest argv) (declare (ignorable argv)) (let* ((*read-default-float-format* 'double-float) (n (read)) (m (read)) (a (make-array 1111 :element-type 'integer :initial-element 0)) (b (make-array 1111 :element-type 'integer :initial-element 0))) (dotimes (_ m) (dotimes (i n) (setf (aref b i) (read))) (dotimes (i n) (incf (aref a i) (aref b i))) (let ((l 0) (r 0) (s 0)) (loop while (< l n) do (loop while (and (< r n) (< s 777)) do (incf s (aref a r)) (incf r)) (when (= s 777) (format t "YES~%") (return-from main 0)) (decf s (aref a l)) (incf l)))) (format t "NO~%")) 0) (main)