//author : raghav_0901
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
//#define int long long int
#define f(i,s,e) for(i=s;i<e;++i)
#define fr(i,s,e) for(i=s;i>=e;i--)
#define all(x) (x).begin(),(x).end()
#define all_r(x) (x).rbegin(),(x).rend()
#define _in(v) for(auto &x:v) cin>>x;
#define ffr(i,s,e,f) for(i=s;i>=e && f;i--)
#define ff(i,s,e,f) for(i=s;i<e && f;++i)
#define mem(arr,val) memset(arr, val, sizeof(arr));
#define _out(v) for(auto x:v) cout<<x<<' '; cout<<'\n';
#define ARENA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
 
const int lim = 1000000;
const int mod = 1e9;

typedef vector<double> vec;
typedef pair<int,int> pr;

//-----------------------------------------functions---------------------------------------------------------------------------------
int gcd(int a,int b) { return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a*b/gcd(a,b);}
inline int n_sum(int n){return (n*(n+1))/2;}
int power(int a,int b){int res=1;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a;a=a*a;}return res;}
int powmod(int a,int b){int res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int gcdExtended(int a,int b,int &x,int &y){if(a==0){x=0;y=1;return b;}int x1,y1,gcd=gcdExtended(b%a,a,x1,y1);x=y1-((b/a)*x1);y=x1;return gcd;}
int modInv(int a,int m){int x,y;gcdExtended(a,m,x,y);return (x%m + m)%m;}
int divM(int a,int b){return (modInv(b,mod)*(a%mod))%mod;}
//------------------------------------------------------------------------------------------------------------------------------------


void _main(void)
{
    int i,num,n,m;cin>>n>>m;
    f(i,0,m)
    {
        cin>>num;n-=num;
    }
    cout<<max(-1,n)<<endl;
    return;
} 

signed main(void)
{
    ARENA
    int t=1,i;//cin>>t;
    f(i,1,t+1)
    {
        //cout<<"Case #"<<i<<": ";
        _main();
    }
    return 0;
}
