#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
typedef long long ll;
const ll longinf=1LL<<60;
using namespace std;


int n,m,a;
int main()
{
    cin>>n>>m;
    for (int i=1; i<=m; ++i)
    {
        cin>>a;
        n-=a;
    }
    if (n>=0) cout<<n<<endl;
    else cout<<-1<<endl;
    return 0;
}

