#include <bits/stdc++.h>
#define rep(i,s,n) for (int i=(s); i<(n); i++)
using namespace std;
using ll = long long;

int main()
{
    int N, M;
    cin >> N >> M;

    int sum = 0;
    rep(i,0,M) {
        int A; cin >> A;
        sum += A;
    }

    cout << max(M - sum, -1) << endl;

    return 0;
}
