#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
void solve() {
  int n, m;
  cin >> n >> m;
  ll sum = 0;
  for (int i = 0; i < m; ++i) {
    int x;
    cin >> x;
    sum += x;
  }
  int ans = n - sum;
  if (ans < 0)
    cout << -1 << "\n";
  else
    cout << ans << "\n";
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
