#include <bits/stdc++.h>
using namespace std;
long long n, m, sum;

int main() {
    cin >> n >> m;
    
    for (int i = 1; i <= m; i++) {
        long long nr;
        cin >> nr;
        sum += nr;
    }

    cout << max((long long) -1, n - sum);
    return 0;
}
