#include<stdio.h>
int main(){
  int N,M;
  scanf("%d %d",&N,&M);
  int *p;
  int days = N;
  p = (int *)malloc(M*sizeof(int));
  for ( int i=0; i < M; i++ ){
    scanf("%d ",(p+i));
  }
  for ( int i=0; i < M; i++){
    days = days - *(p+i);
  }
  if ( days >= 0){
    printf("%d", days);
  }
  else{
    printf("-1");
  }
  return(0);
}