#include <bits/stdc++.h>
using namespace std;
int main()
{
	int N,M;
	cin >> N >> M;

	vector<int> A(M);

	for(int i = 0; i<M; i++){
		cin >> A[i];
		N = N - A[i];
	}

	if(N<0)
		cout << "\n-1";
	else
		cout << "\n" << N;

	return 0;
}