n, m = list(map(int, input().split()))

a = list(map(int, input().split()))



sm = sum(a)

if sm > n:

    print((-1))

else:

    print((n-sm))

n, m = list(map(int, input().split()))

a = list(map(int, input().split()))



if sum(a) > n:

    print((-1))

else:

    print((n-sum(a)))

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
sm = sum(a)
if sm > n:
    print((-1))
else:
    print((n - sm))

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
if sum(a) > n:
    print((-1))
else:
    print((n - sum(a)))

-sm = sum(a) -if sm > n: +if sum(a) > n: -    print((n - sm)) +    print((n - sum(a)))