#include <stdio.h>

int main(void){
   int vacation,hw,i,total=0,tmp;
   scanf("%d%d",&vacation,&hw);

   for(i=0;i<hw;i++){
      scanf("%d",&tmp);
      total+=tmp;
   }

   tmp=vacation-total;
   if(tmp<0) tmp=-1;
   printf("%d\n",tmp);
   return 0;
}