#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <math.h>


int ASC(const void *a, const void *b) {
	return *(int *)b - *(int *)a;//降順
}
int GCD(int a, int b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

int main(void)
{
	int day, homework, ans = 0, n;
	scanf("%d%d",&day,&homework);
	for (int i = 0; i < homework; i++) {
		scanf("%d",&n);
		ans += n;
	}
	ans = day - ans;
	if (ans >= 0)
		printf("%d", ans);
	else
		printf("-1");
	return 0;
}