#include <stdio.h>
#include <math.h>

int main()
{
    long n, m, a, d, i;
    d = 0;
    scanf("%ld %ld", &n, &m);
    for(i = 0; i < m; i++) {
        scanf("%ld", &a);
        d += a;
    }
    n = n - d;
    if(0 <= n) printf("%ld", n);
    else printf("-1");
    return 0;
}