#lang racket

(define (read-int n)
  (if (zero? n)
      null
      (cons (read) (read-int (- n 1)))))

(define (sum items)
  (if (null? items)
      0
      (+ (car items) (sum (cdr items)))))

(define (solve N A)
  (let ([A-sum (sum A)])
    (if (<= A-sum N)
        (- N A-sum)
        -1)))

(let* ([N (read)]
       [M (read)]
       [A (read-int M)])
  (display (solve N A)))
  
