#include <bits/stdc++.h>

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

	int n, m;

	cin >> n >> m;

	while(m--){
        int x;

        cin >> x;

        n -= x;
	}

	if(n >= 0) cout << n << endl;
	else cout << -1 << endl;

	return 0;
}
