//#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<set>
#include<stack>
#include<iomanip>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(n);i++)
template<typename T =ll> using v = vector<T>;
template<typename T =ll> using vv = v<v<T>>;
template<typename T =ll,typename U =ll> using p = pair<T,U>;
template<typename T> T chmin(T &a,T b) {return a=min(a,b);}
template<typename T> T chmax(T &a,T b) {return a=max(a,b);}
const ll INF = (ll)1e9;

void a(){
    double r; cin >> r;
    cout<< fixed <<setprecision(15) <<2*M_PI*r<<endl;
}

void b(){
    ll n,m; cin >> n >> m;
    ll sum=0;
    rep(i,m){
        ll a;
        cin >> a;
        sum+=a;
    }
    cout << ((sum<=n?n-sum:-1));
}


void c(){

}

void d(){

}

void e(){

}

int main(){
    b();
    return 0;
}