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