#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstddef>
#include<queue>
#include<math.h>
#include<iomanip>
using namespace std;

int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> A(M);
    int total = 0;
    for(int i = 0; i < M; ++i)
    {
        cin >> A.at(i);
        total += A.at(i);
    }
    if(N - total >= 0) cout << N - total << endl;
    else cout << -1 << endl;
    return 0;
}
