#include<stdio.h>

int main(void){

    int N,M,A[1001],i,sum = 0,ans;

    scanf("%d %d",&N,&M);
    for(i = 0;i < M;i++){
        scanf("%d",&A[i]);
        sum = A[i];
    }

    ans = N - sum;
    if(ans < 0) printf("-1\n");
    else printf("%d\n",ans);
    return 0;
}