#include<stdio.h>
#include<stdlib.h>
#define BUFSIZE 10000

int N,M,rem1;
int hoge[BUFSIZE]={0};
int main(void){
	scanf("%d",&N);
	scanf("%d",&M);
	for(int i=0;i < M ;i++){
		scanf("%d",&hoge[i]);
		rem1=hoge[i]+rem1;
	}
	if(N-rem1 < 0){
		printf("-1");
	}else{
	printf("%d",N-rem1);
	}
}