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

#define rep(i,n) for (int i = 0; i< (n); ++i)
#define vvec(m,n) vector<vector<int>> (int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()

using ll = long long;

int main(){
    int N, M;
    cin >> N >> M;
    vector<int> A(M);
    int EnjoyDay = N;
    rep(i,M){
        cin >> A.at(i);
        EnjoyDay -= A.at(i);
    }
    if(EnjoyDay < 0) cout << -1 << endl;
    else cout << EnjoyDay << endl;
}