#include "bits/stdc++.h"

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);
	
	int n, m;
	cin >> n >> m;

	vector< int> in(m);
	for (int &e : in) cin >> e;

	int s = accumulate(begin(in), end(in), 0);

	cout << max(-1, n - s) << endl;
}