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

int main () {
  int N, M;
  cin >> N >> M;

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