import sys

input = sys.stdin.readline

from collections import *

from math import *



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

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

S = sum(A)



if S>N:

    print((-1))

else:

    print((N-S))
import sys

input = sys.stdin.readline



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

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

S = sum(A)



if S>N:

    print((-1))

else:

    print((N-S))
import sys

input = sys.stdin.readline
from collections import *
from math import *

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
S = sum(A)
if S > N:
    print((-1))
else:
    print((N - S))

import sys

input = sys.stdin.readline
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
S = sum(A)
if S > N:
    print((-1))
else:
    print((N - S))

-from collections import * -from math import * -