#include<stdio.h>
int main(void){
  int n,m,a[10000],b,c,i;
  scanf("%d %d",&n,&m);
  b=0;
  for(i=0;i<m;i++){
    scanf("%d",&a[i]);
    b=b+a[i];
  }
  c=n-b;
  if(c>=0){
    printf("%d\n",c);
  }else{
    printf("-1\n");
  }
  return 0;
}
