#include<stdio.h>
int main(void)
{
    int N,M,day[1000];
    scanf("%d%d",&N,&M);
    int left = N;
    for(int i=0;i<M;i++)
    {
        scanf("%d",&day[i]);
        left = left - day[i];
    }
    if(left<0)
    {
        printf("-1");
    }
    else
    {
        printf("%d",left);
    }
    

}