#include<stdio.h>
int main(void)
{
 int N,M,n,play;
 int sum =0;
 scanf("%d",&N);
 scanf("%d",&M);
  
 int m[M];
  
 for(n=0;n<M;n++){
   scanf("%d",&m[n]);
   sum += m[n];
 }
 play =N-sum;
 if(play>=0)
   printf("%d",play);
 else
   printf("-1");
  
 return 0;
}