#import <Foundation/Foundation.h>
#import <stdio.h>

int main(int argc, char **argv) {
	NSInteger M, N;
    scanf("%ld %ld", &M, &N);
    for (NSInteger i = 0; i < N; i++) {
    	NSInteger cost;
        scanf("%ld", &cost);
    	M -= cost;
    }
    printf("%ld", MAX(-1, M));
	return 0;
}