#include <stdio.h>

int main()
{
	int N,M,A,homework = 0;
	scanf("%d %d",&N,&M);
	for (int i = 0;i < M;i++){
		scanf("%d",&A);
		homework += A;
	}

	if (homework <= N){
		printf("%d\n",N - homework);
	}else{
		printf("-1\n");
	}
	return 0;
}
