#include <stdio.h>


void solve(int n, int m) {
    int a,sum=0;
    while(m--) {
        scanf("%d",&a);
        sum+=a;
    }
    n-=sum;
    if(n<0) printf("-1");
    else printf("%d",n);
}

int main () {
    int n,m;
    scanf("%d%d",&n,&m);
    solve(n,m);
}
