include<stdio.h>
int main()
{
  int date, HW, HWdate, HWsum = 0, play;
  scanf("%d", date);
  scanf("%d",HW);
  for(i=0;i<HW;i++){
    HEdate = 0;
    scanf("%d",&HWdate);
    HWsum = HWsum + HWdate;
  }
  play = date - HWsum;
  
  if(play<0){
    play = -1;
  }

  printf("%d",play);
  
  return 0;
}