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

int main() {
  int N, M;
  cin >> N >> M;
  vector <int>A(M);
  int SUM;
  for(int i = 0; i < M ; i++){
    cin >> A.at(i);
    N-=A.at(i);
    //cout << A.at(i) << endl;
  }
  //cout << SUM << endl;
  //int C=N-(SUM);
  //cout << C << endl;  
  if (N >= 0){
  cout << N << endl;
  }
  else{
    cout << -1 << endl;
  }
}
