#include <stdio.h>

int main(void) {
    
    int N = 0;
    int M = 0;
    scanf("%d %d", &N, &M);
    
    int x[10000] = { 0 };
    for (int i = 0; i < M; i++ ) {
        scanf("%d ", &x[i]);
    }
    
    int total = 0;

    for (int i = 0; i < M; i++) {
        total += x[i];
    }
    
    int pol = N - total;
    if (pol >= 0) {
        printf("%d", pol);
    }
    else {
        printf("%d",-1);
    }
    return 0;
}