#include<stdio.h>

int main(){
	
	
	int n,m;
	int a[m];
	int sum =0;
	int free_days;
	
	scanf("%d %d",&n,&m);
	
	for(int i=0;i<m;i++){
		
		scanf("%d",&a[i]);
	}
	
	for(int i=0;i<m;i++){
		
		sum = sum + a[i];
    }
		if(sum<n)
		{
		    free_days= n-sum;
	     	printf("%d",free_days);
	    }
	    else{
		
		     printf("-1");
	    }
	
	return 0;
}