#include <stdio.h>

#define NUMBER 10000

int main(void){

        int a,b;
        int c[NUMBER] = {0};
        int d = -1; 
        int e = 0;

scanf("%d %d",&a,&b);

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

for(int j=0;j<b;j++){
        e += c[j];
}

if(a<e){
                printf("%d",d);
}else{
                printf("%d",a-e);
}
return 0;
}
