    //Bismillah hirrahmanir Rahim
    #include<bits/stdc++.h>
    #define ll long long
    #define pb push_back
    #define dbug printf("I am here\n");
    #define Fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  using namespace std;
int main() {
    ll int tst,n,x;
  cin>>n>>tst;
  while(tst--){
cin>>x;
n-=x;
  }
  if(n>-1)cout<<n<<endl;
  else cout<<"-1"<<endl;
    return 0;
  }
