#include <math.h>
#include <stdlib.h>
#define MIN(a, b) (a<b?a:b)
#define MAX(a, b) (a>b?a:b)


int main()
{
    int n, m;
    int a[10000];
    scanf("%d %d", &n, &m);
    for( int i=0; i<m; i++ )
    {
        scanf("%d", a+i);
        n -= a[i];
    }
    printf("%d", MAX(-1, n));

    return 0;
}
