#include <bits/stdc++.h>
 
using namespace std;
 
#define FOR(i, n) for(int i = 0; i < (int) n; i++)
#define rall(x) x.rbegin(), x.rend()
#define all(x) x.begin(), x.end()
#define PB push_back
#define F first
#define S second
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
 
const ll MOD = 1e9+7;

int main(){
	ios::sync_with_stdio(false); cin.tie(0);
 	int n, m; cin >> n >> m;
 	int sum = 0;
 	FOR(i, m){
 		int x; cin >> x;
 		sum+=x;
 	}
 	cout << max(n-sum, -1) << '\n';
 
	return 0;
}