#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const double EPS = 1e-9;
const long long INF = 10e17;
double equal(double a, double b) { return fabs(a - b) < DBL_EPSILON; }
std::istream &operator>>(std::istream &in, set<int> &o) {
  long long a;
  in >> a;
  o.insert(a);
  return in;
}
std::istream &operator>>(std::istream &in, queue<int> &o) {
  long long a;
  in >> a;
  o.push(a);
  return in;
}
bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }
const int mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  vector<long long> homeworks(m);
  for (int i = 0; i < (m); ++i) cin >> homeworks[i];
  long long sum = accumulate(homeworks.begin(), homeworks.end(), 0ll);
  cout << max(n - sum, -1ll) << endl;
}
