(define (three-seven? l) (cond [(null? l) #f] [(member (+ 777 (car l)) (cdr l)) #t] [else (three-seven? (cdr l))])) (define (read-acc n) (let loop ([x n] [l '(0)]) (cond [(zero? x) (reverse l)] [else (let ([v (read)]) (loop (- x 1) (cons (+ (car l) v) l)))]))) (define (main args) (let* ([n (read)] [m (read)]) (print (let loop ([x m] [l (make-list (+ n 1) 0)]) (cond [(zero? x) "NO"] [else (let* ([rl (read-acc n)] [nl (map + l rl)]) (if (three-seven? nl) "YES" (loop (- x 1) nl)))])))) 0)