x=eval(input())

z=eval(input())

y=[]

a=[]

y = x.split()

a = z.split()

a = list(map(int,a))

y = list(map(int,y))

if (sum(a)>y[0]):

    print((-1))

else:

    print((y[0]-sum(a)))

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

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

sum=sum(x)

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

x = eval(input())
z = eval(input())
y = []
a = []
y = x.split()
a = z.split()
a = list(map(int, a))
y = list(map(int, y))
if sum(a) > y[0]:
    print((-1))
else:
    print((y[0] - sum(a)))

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

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