#include <stdio.h>

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