#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main(void){
	int n,m;
	scanf("%d%d",&n ,&m);
	int a[m];
	int i;
	for(i=0;i<m;i++){
		scanf("%d",&a[i]);
		n = n - a[i];
	}
	if(n<0){
		n = -1;
	}
	printf("%d\n",n);
    return 0; 
}
