N, M = list(map(int, input().split()))

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



d = sum(A)



if N < d:

  print((-1))

else:

  print((N-d))
N, M = list(map(int, input().split()))

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

d = sum(As)

if N < d:

    print((-1))

else:

    print((N-d))

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
d = sum(A)
if N < d:
    print((-1))
else:
    print((N - d))

N, M = list(map(int, input().split()))
As = list(map(int, input().split()))
d = sum(As)
if N < d:
    print((-1))
else:
    print((N - d))

-A = list(map(int, input().split())) -d = sum(A) +As = list(map(int, input().split())) +d = sum(As)