#include <stdio.h>
#include <stdlib.h>

int main (void) {
    int n, m;

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

    int a[m];

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

    if ( sum_day > n )
        printf("-1\n");
    else
        printf("%d\n", n - sum_day);

    return EXIT_SUCCESS;
}
