#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<iomanip>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (2e9)
// cout << setprecision(10)

using namespace std;
typedef long long int ll;

int N, M;
int A, T;
int main(void){
    cin >> N >> M;
    REP(i,M) {
        cin >> A;
        T += A;
    }
    cout << max(-1, N - T) << endl;
    return 0;
}

