#pragma warning(disable:4996)
#include <stdio.h>

typedef long long int64;

int64 alladd(int* i,int v) 
{
	int64 a = 0;
	for (int j = 0; j != v; j++)
	{
		a += (int64)i[j];
	}
	return a;
}

int main()
{
	int n, m, a[10001];
	scanf("%d %d", &n, &m);
	for (int i = 0; i != m; i++) 
	{
		scanf("%d", &a[i]);
	}

	int64 b = alladd(a, m);

	b = n - b;
	if (b < 0) {
		b = -1;
	}
	printf("%lld", b);

	return 0;
}