#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using namespace std;
int main()
{
	int n, m, t, tot;
	cin >> n >> m;
	tot = 0;
	rep(i, m) {
		cin >> t;
		tot += t;
	}
	cout << max(-1, n - tot) << endl;
	return 0;
}
