#include <bits/stdc.h>
using namespace std;

int main() {
    int M, N, i, cnt = 0;
    int free;
    cin >> N >> M;
    vector<int> hw(M);
    for (i = 0; i < M; i++) {
        cin >> hw.at(i);
        cnt += hw.at(i);
    }
    free = N - cnt;
    if (free > 0) cout << free << endl;
    else cout << "-1" << endl;
}
