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