#include <stdio.h>
#include <stdlib.h>

int main(void) {
    int n,m,t;
    (void)scanf("%d %d",&n,&m);
    while(m){
        (void)scanf("%d",&t);
        n-=t;
        m--;
    }
    if(n<0)n=-1;
    printf("%d\n",n);
    return 0;
}