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

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