#include<stdio.h>
#include<math.h>

int n,m,sum=0,i,in;
int main()
{
     scanf("%d %d",&n,&m);
     for( i=1;i<=m;i++) {scanf("%d",&in); sum=sum+in;}
     sum=n-sum;
     if(sum<=0) {printf("-1\n");return 0;}
     printf("%d\n",sum);
}
