#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long gcdll(long long a, long long b) {
  if (!b) return a;
  return gcdll(b, a % b);
}
void seive(int n) {
  vector<bool> is_prime(n + 1, true);
  is_prime[0] = is_prime[1] = false;
  for (int i = 2; i * i <= n; i++) {
    if (is_prime[i]) {
      for (int j = i * i; j <= n; j += i) {
        is_prime[j] = false;
      }
    }
  }
}
vector<int> constructZFunc(string s) {
  int n = s.size();
  vector<int> z(n);
  int l, r;
  l = r = 0;
  z[0] = 0;
  for (int i = 1; i <= n - 1; i++) {
    z[i] = 0;
    if (i <= r) {
      z[i] = min(r - i + 1, z[i - l]);
    }
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) {
      r = i + z[i] - 1;
      l = i;
    }
  }
  return z;
}
void solve() {
  long long n, m, x;
  cin >> n >> m;
  long long days = 0ll;
  for (int i = 0; i < m; i++) {
    cin >> x;
    days += x;
  }
  cout << ((days > n) ? -1 : (n - days));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
