#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>

using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

int main() {

    ll N,M;
    cin >> N >> M;
    ll A[M];
    rep(i,M) cin >> A[i];
    ll out = N;
    rep(i,M){
        out -= A[i];
    }
    if(out<0) out = -1;
    cout << out << endl;
    return 0;
}
