#include <bits/stdc++.h>
using namespace std;

#pragma GCC optimize("Ofast")
#define rep(i,a,n) for(int i=a; i<n; i++)
typedef long long ll;
typedef pair<int,int> P;
const ll MOD = (int)1e9+7;
const ll INF = MOD*MOD;
const ll powll = 1LL<<1;

int main(){
	ll n,m; cin >> n >> m;
    ll sum = 0;
    rep(i,0,m){
        int a; cin >> a;
        sum += a;
    }
    cout << max(-1LL, n-sum) << "\n";
}