#include<stdio.h>
int main(void){
  int yasu,m,i,sum=0;
  scanf("%d %d",&yasu,&m);
  int kadai[m];
  for(i=0;i<m;i++){
    scanf("%d",&kadai[i]);
    sum+=kadai[i];
  }
  yasu-=sum;
  if(yasu>=0){
    printf("%d",yasu);
  }else{
    printf("-1");
  }
  return 0;
}