#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main() {
  int N, M; cin >> N >> M;
  vector<int> A(M);

  int res = N;
  rep(i, M) {
    res -= A.at(i);
  }

  cout << min(-1, res) << endl;
  return 0;
}
