(use srfi.217) (define yuki607 (let* ( (n-m (map string->number (string-split (read-line) " "))) (n (car n-m)) (m (cadr n-m)) (r (make-vector n 0)) (ok 0) ) (define (process-line line) (let* ( (a (map string->number (string-split line " "))) (d (iset 0)) (c 0) ) (for-each (lambda (i) (vector-set! r i (+ (vector-ref r i) (list-ref a i))) (set! c (+ c (vector-ref r i))) (when (iset-member d (- c 777) #f) (set! ok 1)) (set! d (iset-adjoin! d c))) (iota n) ))) (for-each (lambda (_) (process-line (read-line))) (iota m)) (if (= ok 1) (display "YES") (display "NO"))))