#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> A(M);
  for (int i = 0; i < (M); i++) cin >> A.at(i);
  ll workDays = 0;
  for (int i = 0; i < (M); i++) {
    workDays += A.at(i);
  }
  ll ans = (N - workDays >= 0) ? N - workDays : -1;
  cout << ans << endl;
  return 0;
}
