#include<stdio.h>

int main(void){
   int N,M,i;
   int data[M];
   int days=0;
   scanf("%d %d",&N,&M);
   for(i=0;i<M;i++){
      scanf("%d",&data[i]);
      days+=data[i];
   }
   if(N-days>=0){
      printf("%d\n",N-days);
   }else{
      printf("-1\n");
   }
   return 0; 
}
