#include<cstdio>
#include<string>
#include<cstring>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<cmath>
#include<bitset>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<complex>
#define inf 0x3f3f3f3f3f3f3f3f
#define fi first
#define se second
#define pb push_back
#define ll long long
#define pii pair<int,int> 
const int N=1e6+10;
const int mod=998244353;
using namespace std;


void solve(){
   int n,m; scanf("%d%d",&n,&m);
   for(int i=1,x;i<=m;++i) scanf("%d",&x),n-=x;
   n=max(n,-1);
   printf("%d\n",n);
}
int main() 
{
    int _=1;  //scanf("%d",&_);
    while(_--) solve();
return 0;
}
/*
*/
 