#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const ll INF = 1LL << 60;
int main() {
  int n, m;
  cin >> n >> m;
  for (ll i = 0; i < (ll)(m); i++) {
    int a;
    cin >> a;
    n -= a;
  }
  int ans = n;
  if (ans < 0) ans = -1;
  cout << ans << endl;
  return 0;
}
