#include<stdio.h>
int main(void) {
	int n,m,i,sum = 0;
	scanf("%d %d", &n, &m);
	int a[i];
	for(i=0; i<m; i++) {
		scanf("%d ", &a[i]);
		sum += a[i];
	}
	int x = n - sum;
	if(x >= 0) {
		printf("%d", x);
	} else {
		printf("-1");
	}
	return 0;
}