#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstdlib>
#include<queue>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define P pair<int, int>

int main(){
    int n, m;
    cin >> n >> m;
    int a[m];
    rep(i, m) cin >> a[i];
    rep(i, m) n -= a[i];
    cout << max(n, -1) << endl;
    
}
