#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define fir first 
#define sec second
#define int long long
#define endl "\n"
using namespace std;
const int nax=1e5+5;
vector<int>adj[nax];
const int mod=1e9+7;
const int inf=1e18+7;

signed main(){
	int n,m;
	cin>>n>>m;
	int sum=0;
	for(int i=0;i<m; i++){
		int a;
		cin>>a;
		sum+=a;
	}
	int ans= n-sum>=0?n-sum:-1;
	cout<<ans<<endl;
	return 0;
}

