#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl ;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;

#define rep(i,N) for(int i=0; i < (int)N; i++)
#define all(v) (v).begin(),(v).end()

const int INF = 100000002;

int main(){
	int n, m; cin >> n >> m;
	vi a(m);
	ll day = 0; 
	rep(i,m){
		int a; cin >> a;
		day += a;
	}
	cout << ((n - day)>=0 ?(n-day): -1) << endl;
}