#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define repr(i,x,n) for(int i=x; i<(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
typedef long long ll;
using VI = vector<int>;
using VS = vector<string>;
using graph = vector<vector<int>>;
int main()
{
int n,m,homework_days=0;
cin>>n>>m;
for (int i = 0; i < m; i++)
{
    int days;
    cin>>days;
    homework_days+=days;
}

if (homework_days<=n)
{
    cout<<n-homework_days<<endl;
}
else
{
    cout<<-1<<endl;
}

    return 0;
}