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

#define rep(i,l,n) for(int (i)=(l);(i)<(n);(i)++)
#define min(a,b) (a)<(b)?(a):(b)
#define max(a,b) (a)>(b)?(a):(b)
#define abs(a) (a)>0?(a):-(a)
#define llong long long

int main(){
	int N,M; scanf("%d %d",&N,&M);
	int a;
	rep(i,0,M){
		scanf("%d",&a);
		N -= a;
	}
	if( N<0 ) printf("-1");
	else printf("%d",N);
	return 0;
}
