#include <stdio.h>

int main (void) {
    int N, M;

    scanf("%d%d", &N, &M);

    int A[M];
    int sum = 0;
    int i = 0;

    for (int i = 0; i < M; i++) {
        scanf("%d", &A[i]);
        sum += A[i];
    }

    if (N - sum >= 0) {
        printf("%d\n", N - sum);
    } else {
        printf("-1\n");
    }

    return 0;
}