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

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

x = 0

for i in range(NM[1]):

    x += a[i]



if x > NM[0]:

    print((-1))

else:

    print((NM[0] - x))
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()))
a = list(map(int, input().split()))
x = 0
for i in range(NM[1]):
    x += a[i]
if x > NM[0]:
    print((-1))
else:
    print((NM[0] - x))

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)))

+N, M = NM[0], NM[1] -x = 0 -for i in range(NM[1]): -    x += a[i] -if x > NM[0]: +if sum(a) > N: -    print((NM[0] - x)) +    print((N - sum(a)))