#include <stdio.h>
#define sz 1000
int main()
{
    int i,n,m, a[sz],sum=0, vac;

    scanf("%d %d",&n,&m);

    for( i=0 ; i<m ; i++ )
        scanf("%d",&a[i]);

    for( i=0 ; i<m ; i++ )
        sum = sum + a[i];


    vac = n-sum;

    if( vac<0 )
        printf("-1\n");
    else
        printf("%d\n",vac);


    return 0;
}
