#include <stdio.h>

int main(void){

	int N=0,M=0,sum=0,i=0,day=0;
	  
	scanf("%d",&N);
  	scanf("%d",&M);
  	
  	int A[M];
  	for(i=0;i<M;i++){
   		scanf("%d",&A[i]);
    	sum=sum+A[i];
    }
  	
  	day=N-sum;
  	if(day<0){
    	printf("-1");
    }else if(day>=0){
    	printf("%d",day);
    }
  
  	return 0;
  
}
