#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define MOD 1000000007;
#define MOD2 998244353;
#define INF ((1<<30)-1);
#define LINF (1LL<<60);
#define EPS (1e-10);
typedef long long Int;
typedef pair<Int, Int> P;

Int n, m;
Int a;

int main() {
    cin >> n >> m;
    Int sm = 0;
    rep(i,m) {
        cin >> a;
        sm += a; 
    }
    Int ans = n - sm;
    if (ans < 0) ans = -1;
    cout << ans << endl;
}