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