/* 163b.c */
#include <stdio.h>

int main(void){
    int sd,hw,count,play=0;
    int a[100000]={0};
    scanf("%d %d",&sd,&hw);
    for(int i=0; i<hw; i++){
        scanf("%d", &a[i]);
    }
    for(int i=0; i<sd; i++){
        if(a[i]!=0){
        count = count+a[i];
        }
    }
    if(sd<count){
        count = -1;
        printf("%d", count);
    }else{
        play = sd - count;
        printf("%d",play);
    }
    return 0;
}