#include <stdio.h>

int main(void){
    int i,n,m,a[10000],ans=-1;
    scanf("%d %d",&n,&m);
    for(i=0;i<m;i++){
        scanf("%d",&a[i]);
        n -= a[i];
    }
    if(n>=0) ans = n;
    printf("%d\n",ans);
    return 0;
}