#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N, M;
    cin >> N >> M;
    int days = 0;
    for (int i=0; i<M; i++){
        int a;
        cin >> a;
        days += a;
    }

    if (N - days >= 0 ){
        cout << N - days << endl;
    }
    else {
        cout << -1 << endl;
    }
}