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

int main(){

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

    return 0;
}