# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solve():
    n, m = MI()
    A = LI()

    sm = sum(A)
    if n - sm >= 0:
        print(n - sm)
    else:
        print(-1)


if __name__ == '__main__':
    solve()
