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

int		main()
{
	int		N, M, A;
	int	 sum = 0, ans;

	scanf("%d %d\n", &N, &M);
	for (int i = 0; i<M;i++)
	{
		scanf("%d ", &A);
		sum += A;
	}
	ans = N - sum;
	if (ans < 0)
		ans = -1;
 	printf("%d\n", ans);
	return (0);
}