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

int main(void)
{
	unsigned long n;
	unsigned m, a[10010], s = 0;
	int i, b;
	
	scanf("%ld%d", &n, &m);
	for (i = 1; i <= m; ++i) {
		scanf("%d", &a[i]);
		s += a[i];
	}
	b = n - s;
	if (b >= 0)
		printf("%d", b);
	else
		printf("%d", -1);
	return EXIT_SUCCESS;
}
