#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)

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