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

int main()
{
  int N,M;
  cin >>N>>M;
  int S;
  int tmp;
  for(int i= 0;i<N;i++){
    cin >>tmp;
    S +=tmp;
  }
  if(S<=N){
    cout<<N-S<<endl;
  }else{
    cout<<-1<<endl;
  }
}


