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

N, M = NM[0],NM[1]

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



if  sum(a)> N:

    print((-1))

else:

    print((N - sum(a)))
NM = list(map(int, input().split()))

N, M = NM[0],NM[1]

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

A = sum(a)

if  A> N:

    print((-1))

else:

    print((N - A))
NM = list(map(int, input().split()))
N, M = NM[0], NM[1]
a = list(map(int, input().split()))
if sum(a) > N:
    print((-1))
else:
    print((N - sum(a)))

NM = list(map(int, input().split()))
N, M = NM[0], NM[1]
a = list(map(int, input().split()))
A = sum(a)
if A > N:
    print((-1))
else:
    print((N - A))

-if sum(a) > N: +A = sum(a) +if A > N: -    print((N - sum(a))) +    print((N - A))