#include <stdio.h>
#include <stdlib.h>
#include <string.h>
 
int main(void){
	int N,M,Day;
	int i;
	char str[10000000];
 
	fgets(str, sizeof(str), stdin);
	N=atoi(strtok(str," "));
	M=atoi(strtok(NULL," "));


	fgets(str, sizeof(str), stdin);
	Day=N-atoi(strtok(str," "));
	for(i=1;i<M;i++){
		Day-=atoi(strtok(NULL," "));
	}

	if(Day>=0){
		printf("%d\n",Day);
 	}else{
		printf("-1\n");
	}

	return 0;
}