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

int N, M;

int main() {
    cin >> N >> M;
    int ans=0;
    for (int i = 0; i < M; i++) {
        int day;
        cin >> day;
        ans += day;
    }
    if (ans > N) {
        cout << "-1" << "\n";
    }
    else {
        cout << N-ans << "\n";
    }
    return 0;
}
