import numpy as np

import math



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

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



a = sum(A)



if n < a:

    print((-1))

else:

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

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



homework = sum(A) 

print((n - homework if n - homework >= 0 else -1))

import numpy as np
import math

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

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

-import numpy as np -import math - -a = sum(A) -if n < a: -    print((-1)) -else: -    print((n - a)) +homework = sum(A) +print((n - homework if n - homework >= 0 else -1))