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

int main()
{
	long long int nn, mm, tmp, sum = 0;
	scanf("%lld %lld", &nn, &mm);
	for(int ii = 0;ii < mm;ii++)
	{
		scanf("%lld", &tmp);
		sum += tmp;
	}
	printf("%lld\n", (sum < 0 ? (-1) : (nn - sum)));
	return 0;
}