#include<stdio.h>
int main(){
  int i,day,num,vol,total,ans;
  total = 0;
  scanf("%d%d",&day,&num);
  for(i=0;i<num;i++){
    scanf("%d",&vol);
    total = total + vol;
  }
  ans = day - total;
  if(ans<0)
    ans = -1;
  printf("%d\n",ans);
  return 0;
}