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

int main() {

    int N,M;
    cin >> N >> M;
    
    int sum = 0;
    int x;
    
    rep (i,M) {
        cin >> x;
        sum += x;
    }
    
    if (N - sum >= 0) {
        cout << N - sum << endl;
    }
    
    else { cout << -1 << endl;
         }
    
}
