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

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

total=sum(a)

if n<total:

    print((-1))

else:

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

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

a_sum=sum(a)



if n<a_sum:

    print((-1))

else:

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

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

-total = sum(a) -if n < total: +a_sum = sum(a) +if n < a_sum: -    print((n - total)) +    print((n - a_sum))