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

int main()
{
	int n, m, tmp;
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++) {
		scanf("%d", &tmp);
		n -= tmp;
	}
	if (n < 0)
		n = -1;
	printf("%d", n);

	return 0;
}