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