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