N, M = [int(i) for i in input().split()]

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



ans = N - sum(A)

print((ans if ans >= 0 else -1))
N, M = [int(i) for i in input().split()]

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

print((ans if (ans := N - sum(A)) >= 0 else -1))
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
ans = N - sum(A)
print((ans if ans >= 0 else -1))

N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
print((ans if (ans := N - sum(A)) >= 0 else -1))

-ans = N - sum(A) -print((ans if ans >= 0 else -1)) +print((ans if (ans := N - sum(A)) >= 0 else -1))