#include<stdio.h>

int main(){

    int day;
    int homework;
    int homework_day[10001];
    int i=0;
    int homework_day_ruiseki=0;
    int play=0;

    scanf("%d %d",&day,&homework);

    while(i < homework){
        scanf("%d",&homework_day[i]);
        i++;
    }

    i = 0;

    while(i < homework){
        homework_day_ruiseki += homework_day[i];
        i++;   
    }

    play = day - homework_day_ruiseki;

    if(play <= -1)play = -1;
    
    printf("%d\n",play);

    return 0;
}