#include <iostream>
using namespace std;

int main(void)
{
	int N, M;
	int i, a;

	cin >> N >> M;

	for (i = 0;i < M;i++)
	{
		cin >> a;
		N -= a;
	}

	if (N < 0)
	{
		cout << -1 << endl;
	}
	else
	{
		cout << N << endl;
	}
	
}