#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
int main() {
  ll n, m;
  cin >> n >> m;
  vector<int> a(n);
  for (int i = 0; i < (m); ++i) cin >> a[i];
  for (int i = 0; i < (m); ++i) n = n - a[i];
  if (n < 0)
    cout << -1 << endl;
  else
    cout << n << endl;
  return 0;
}
