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

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

if n-sum(a)<0:

  print((-1))

else:

  print((n-sum(a)))

  

  

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

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

if n-sum(a) >= 0:

    print((n-sum(a)))

else:

    print((-1))

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

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

-if n - sum(a) < 0: +if n - sum(a) >= 0: +    print((n - sum(a))) +else: -else: -    print((n - sum(a)))