#include <stdio.h>
int main(void){
long int n,m;  //day homework
scanf("%ld %ld",&n,&m);
int b;
int fin=0;

for(int i=0;i<m;i++){
  scanf("%d",&b);
  fin=fin+b;
}

n=n-fin;
if(fin<0){
  printf("-1");
  return 0;
}
printf("%ld",n);
  return 0;
  }