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

    }
    ans=vacation-sum;
    if(ans<0)
    {
        printf("%d",-1);
    }
    else
    {
        printf("%d",ans);
    }

  return 0;

}
