#include <stdio.h>
int main(void){
int n,m;
int sum = 0;
scanf("%d %d",&n,&m);
int c[m];
for (int i = 0;i < m;i++){
	scanf("%d",&c[i]);
	sum += c[i];
	}
	n -= sum;
	if(n < 0) printf("-1");
	else printf("%d",n);
  	return 0;
}
