#include <iostream>
#include <math.h>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

int main(void)
{
    ll n,m;
    cin >> n >> m;

    vector<int> a(m);

    rep(i,m){
        cin >> a.at(i);
        n -= a.at(i);
    }

    if(n<0)n=-1;

    cout << n << endl;

    return 0;
}
