n, m = input().split()

a = [int(i) for i in input().split()]

if int(n) >= sum(a):

  print((int(n)-sum(a)))

else:

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

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

print((n-sum(a) if n >= sum(a) else -1))

n, m = input().split()
a = [int(i) for i in input().split()]
if int(n) >= sum(a):
    print((int(n) - sum(a)))
else:
    print((-1))

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

-n, m = input().split() -a = [int(i) for i in input().split()] -if int(n) >= sum(a): -    print((int(n) - sum(a))) -else: -    print((-1)) +n, m = list(map(int, input().split())) +a = list(map(int, input().split())) +print((n - sum(a) if n >= sum(a) else -1))