#include<stdio.h>
int main()
{
    int vacation,assignment,i,arr[20],sum=0,ans;
    scanf("%d %d",&vacation,&assignment);
    for(i=0;i<assignment;i++)
    {
        scanf("%d",&arr[i]);
        sum=sum+arr[i];
    }
    ans=vacation-sum;
    if(ans<-1)
    {
        printf("-1");
    }
    else
    {
        printf("%d",ans);
    }
	return 0;

}
