#include<stdio.h>

int main()
{
	int i,n, m, a[10000],b;

	scanf("%d %d", &n, &m);
	for (i = 0;i <= m-1;i++) {
		scanf("%d", &a[i]);
		b = b + a[i];
	}
	if (b <= n) {
		printf("%d", n - b);
	}
	else {
		printf("-1");
	}
	return 0;
}