#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
  int N,M;
  cin >> N >> M;
  vector<ll> A(N);
  for(ll i=0;i<M;++i) cin >> A[i];
  ll sum = accumulate(A.begin(),A.end(),0);
  if(sum>N) cout << "-1" << endl;
  else cout << N-sum << endl;
}