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

void solve(long long N, long long M, std::vector<long long> A)
{
    long long res = 0;
    for (int i = 0; i < M; i++)
    {
        res += A[i];
    }

    cout << max(-1LL, N - res) << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    std::vector<long long> A(M);
    for (int i = 0; i < M; i++)
    {
        scanf("%lld", &A[i]);
    }
    solve(N, M, std::move(A));
    return 0;
}
