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

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

asum=sum(a)



if(n-asum)<0:

    print("-1")

    exit()

else:

    print((n-asum))

    exit()

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

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

asum=sum(a)



if(n-asum)<0:

    print("-1")

else:

    print((n-asum))

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

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

-    exit() -    exit()