#include <iostream>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	int a[m];
	int ans = n;
	for (int i = 0; i < m; i++) {
		cin >> a[i];
		ans -= a[i];
	}

	if (ans < 0) {
		ans = -1;
	}
	cout << ans << endl;
	return 0;
}