#include <stdio.h>


int main(void)
{
    int i;
    int n,m;
    int a[10001];
    int holiday;

    scanf("%d %d",&n,&m);
    for(i=0;i<m;i++){
        scanf("%d",&a[i]);
    }

    holiday=n;
    for(i=0;i<m;i++){
        holiday-=a[i];
    }

    if(holiday<=-1){
        holiday=-1;
    }

    printf("%d\n",holiday);

    return 0;
}