#include <stdio.h>
typedef long long LL;

int main(){
    LL N, M;
    scanf("%lld%lld", &N, &M);
    LL buf, shukudai = 0;
    for(LL i=0; i<M; i++){
        scanf("%lld", &buf);
        shukudai += buf;
    }
    LL ans = N-shukudai;
    printf("%lld\n", ans>-1 ? ans: -1);
    return 0;
}