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

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

ans = N - sum(A)

if ans < 0:

    print((-1))

else:

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

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

a = sum(A)

if (N-a)<0:

  print((-1))

else:

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

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

-ans = N - sum(A) -if ans < 0: +a = sum(A) +if (N - a) < 0: -    print(ans) +    print((N - a))