#include <stdio.h>

int main(void){
  int i,N,num,ans=0,sum=0;
  int buf[1000000];
	scanf("%d %d",&N,&num);
	for(i = 0;i < num; i++){
	  scanf("%d",&buf[i]);
	  sum += buf[i];
	}
  
	ans = N - sum;
	if(ans > -1)
	  printf("%d\n",ans);
	else 
	  printf("-1\n");
	  return 0;

}
