#include <stdio.h>
int main(void){
    // Your code here!
    int ans,n,m,i,sum=0,a;
    scanf("%d %d",&n,&m);
    for(i=0; i<m; i++){scanf("%d",&a); sum+=a;}
    ans = n - sum;
    if(ans<0) ans=-1;
    printf("%d",ans);
    return 0;
}
