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

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