#include<stdio.h>
void 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<0)
    {
        printf("%d",-1);
    }
    else
    {
        printf("%d",ans);
    }


}
