
#include <stdio.h>

int main(void)
{
    int N, M;
    int sum = 0;
    int result = 0;
    scanf("%d", &N);
    scanf("%d", &M);
    for(int i=0; i<M; i++){
        int data;
        scanf("%d", &data);
        sum = sum + data;
    }
    result = N - sum;
    if(result >= 0){
        printf("%d", result);
    }else{
        printf("-1");
    }
    
    return 0;
}
