#include <stdio.h>

int main(void){

    int N = 0;
    int M = 0;
    
    scanf("%d %d", &N, &M);

    int A[M];

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

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

    return 0;
}