import sys

input = sys.stdin.readline



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

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



if n < sum(a):

    print((-1))

else:

    print((n-sum(a)))

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

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



print((-1 if n < sum(a) else n - sum(a)))
import sys

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

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

-import sys - -input = sys.stdin.readline -if n < sum(a): -    print((-1)) -else: -    print((n - sum(a))) +print((-1 if n < sum(a) else n - sum(a)))