

N, M = list(map(int, input().split()))

work = []

[work.append(x) for x in map(int, input().split())]



s = sum(work)

if N >= s:

    print((N - s))

else:

    print('-1')



import math



ex = []

N, M = map(int, input().split())

ex = [exi for exi in map(int, input().split())]



rem = N - sum(ex)

print(rem) if rem >= 0 else print('-1')





N, M = list(map(int, input().split()))
work = []
[work.append(x) for x in map(int, input().split())]
s = sum(work)
if N >= s:
    print((N - s))
else:
    print("-1")

import math

ex = []
N, M = map(int, input().split())
ex = [exi for exi in map(int, input().split())]
rem = N - sum(ex)
print(rem) if rem >= 0 else print("-1")

-N, M = list(map(int, input().split())) -work = [] -[work.append(x) for x in map(int, input().split())] -s = sum(work) -if N >= s: -    print((N - s)) -else: -    print("-1") +import math + +ex = [] +N, M = map(int, input().split()) +ex = [exi for exi in map(int, input().split())] +rem = N - sum(ex) +print(rem) if rem >= 0 else print("-1")