#include<stdio.h>

int main()

{
 int a,b,c,i,sum=0;

 scanf("%d %d",&a,&b);

 for(i=1;i<=b;i++){

  scanf("%d",&c);

  sum+=c;
 }

 if(a>=sum){
  printf("%d\n",a-sum);
 }

 else{
  printf("-1\n");
 }

 return 0;
}
